forked from mirror/Riven
Update to work on stable 1.39
This commit is contained in:
parent
48d0903138
commit
9dfe5a4aaa
20 changed files with 33 additions and 28 deletions
|
@ -14,10 +14,13 @@ travis-ci = { repository = "MingweiSamuel/Riven" }
|
|||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[features]
|
||||
nightly = [ "parking_lot/nightly" ]
|
||||
|
||||
[dependencies]
|
||||
log = "0.4"
|
||||
num_enum = "0.4"
|
||||
parking_lot = { version = "0.9", features = [ "nightly" ] }
|
||||
parking_lot = "0.9"
|
||||
reqwest = { version = "0.10.0-alpha.1", features = [ "gzip", "json" ] }
|
||||
scan_fmt = { version = "0.2", default-features = false }
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
|
|
|
@ -14,7 +14,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
|
|||
///
|
||||
/// The documentation of each variant specifies:<br>
|
||||
/// NAME (`IDENTIFIER`, ID).
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(IntoPrimitive, TryFromPrimitive)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -10,7 +10,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
|
|||
|
||||
/// League of Legends game mode, such as Classic,
|
||||
/// ARAM, URF, One For All, Ascension, etc.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr, IntoStaticStr)]
|
||||
|
|
|
@ -10,7 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends maps.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -10,7 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking queue.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
|
||||
|
||||
/// LoL or TFT ranked queue types.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr, IntoStaticStr)]
|
||||
|
|
|
@ -10,7 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking seasons.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
#![feature(non_exhaustive)]
|
||||
#![feature(external_doc)]
|
||||
#![cfg_attr(feature = "nightly", feature(non_exhaustive))]
|
||||
#![cfg_attr(feature = "nightly", feature(external_doc))]
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
#![doc(include = "../README.md")]
|
||||
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
|
||||
#![cfg_attr(not(feature = "nightly"), doc("See [README.md](https://github.com/MingweiSamuel/Riven#----riven--------------------)."))]
|
||||
|
||||
mod config;
|
||||
pub use config::RiotApiConfig;
|
||||
|
|
|
@ -41,7 +41,8 @@ impl RegionalRequester {
|
|||
-> impl Future<Output = Result<Option<T>>> + 'a
|
||||
{
|
||||
async move {
|
||||
let query = query.as_deref();
|
||||
#[cfg(feature = "nightly")] let query = query.as_deref();
|
||||
#[cfg(not(feature = "nightly"))] let query = query.as_ref().map(|s| s.as_ref());
|
||||
|
||||
let mut retries: u8 = 0;
|
||||
loop {
|
||||
|
|
|
@ -22,7 +22,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
|
|||
///
|
||||
/// The documentation of each variant specifies:<br>
|
||||
/// NAME (`IDENTIFIER`, ID).
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(IntoPrimitive, TryFromPrimitive)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -7,7 +7,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
|
|||
|
||||
/// League of Legends game mode, such as Classic,
|
||||
/// ARAM, URF, One For All, Ascension, etc.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash)]
|
||||
#[derive(EnumString, Display, AsRefStr, IntoStaticStr)]
|
||||
|
|
|
@ -9,7 +9,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends maps.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -13,7 +13,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking queue.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -7,7 +7,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
|
|||
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
||||
|
||||
/// League of Legends matchmaking seasons.
|
||||
#[non_exhaustive]
|
||||
#[cfg_attr(feature = "nightly", non_exhaustive)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
|
||||
#[derive(Serialize_repr, Deserialize_repr)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(my_runner)]
|
||||
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
||||
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
||||
fn my_runner(_: &[()]) { main() }
|
||||
|
||||
use riven::RiotApi;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(my_runner)]
|
||||
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
||||
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
||||
|
||||
mod async_tests;
|
||||
mod testutils;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(my_runner)]
|
||||
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
||||
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
||||
|
||||
mod async_tests;
|
||||
mod testutils;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#![feature(custom_test_frameworks)]
|
||||
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
||||
#![feature(async_closure)]
|
||||
#![test_runner(my_runner)]
|
||||
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
||||
|
||||
mod async_tests;
|
||||
mod testutils;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(my_runner)]
|
||||
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
||||
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
||||
|
||||
mod async_tests;
|
||||
mod testutils;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![feature(custom_test_frameworks)]
|
||||
#![test_runner(my_runner)]
|
||||
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
||||
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
||||
|
||||
mod async_tests;
|
||||
mod testutils;
|
||||
|
|
Loading…
Reference in a new issue