forked from mirror/Riven
1
0
Fork 0

Update to work on stable 1.39

users/mingwei/surf
Mingwei Samuel 2019-11-07 12:45:13 -08:00
parent 48d0903138
commit 9dfe5a4aaa
20 changed files with 33 additions and 28 deletions

View File

@ -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 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
nightly = [ "parking_lot/nightly" ]
[dependencies] [dependencies]
log = "0.4" log = "0.4"
num_enum = "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" ] } reqwest = { version = "0.10.0-alpha.1", features = [ "gzip", "json" ] }
scan_fmt = { version = "0.2", default-features = false } scan_fmt = { version = "0.2", default-features = false }
serde = { version = "1.0", features = [ "derive" ] } serde = { version = "1.0", features = [ "derive" ] }

View File

@ -14,7 +14,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
/// ///
/// The documentation of each variant specifies:<br> /// The documentation of each variant specifies:<br>
/// NAME (`IDENTIFIER`, ID). /// NAME (`IDENTIFIER`, ID).
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(IntoPrimitive, TryFromPrimitive)] #[derive(IntoPrimitive, TryFromPrimitive)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -10,7 +10,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
/// League of Legends game mode, such as Classic, /// League of Legends game mode, such as Classic,
/// ARAM, URF, One For All, Ascension, etc. /// ARAM, URF, One For All, Ascension, etc.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Hash)] #[derive(Eq, PartialEq, Hash)]
#[derive(EnumString, Display, AsRefStr, IntoStaticStr)] #[derive(EnumString, Display, AsRefStr, IntoStaticStr)]

View File

@ -10,7 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
/// League of Legends maps. /// League of Legends maps.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)] #[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -10,7 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
/// League of Legends matchmaking queue. /// League of Legends matchmaking queue.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq)] #[derive(Eq, PartialEq)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -1,7 +1,7 @@
use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr }; use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
/// LoL or TFT ranked queue types. /// LoL or TFT ranked queue types.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Hash)] #[derive(Eq, PartialEq, Hash)]
#[derive(EnumString, Display, AsRefStr, IntoStaticStr)] #[derive(EnumString, Display, AsRefStr, IntoStaticStr)]

View File

@ -10,7 +10,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
/// League of Legends matchmaking seasons. /// League of Legends matchmaking seasons.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)] #[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -1,9 +1,10 @@
#![feature(non_exhaustive)] #![cfg_attr(feature = "nightly", feature(non_exhaustive))]
#![feature(external_doc)] #![cfg_attr(feature = "nightly", feature(external_doc))]
#![forbid(unsafe_code)] #![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; mod config;
pub use config::RiotApiConfig; pub use config::RiotApiConfig;

View File

@ -41,7 +41,8 @@ impl RegionalRequester {
-> impl Future<Output = Result<Option<T>>> + 'a -> impl Future<Output = Result<Option<T>>> + 'a
{ {
async move { 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; let mut retries: u8 = 0;
loop { loop {

View File

@ -22,7 +22,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
/// ///
/// The documentation of each variant specifies:<br> /// The documentation of each variant specifies:<br>
/// NAME (`IDENTIFIER`, ID). /// NAME (`IDENTIFIER`, ID).
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(IntoPrimitive, TryFromPrimitive)] #[derive(IntoPrimitive, TryFromPrimitive)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -7,7 +7,7 @@ use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr };
/// League of Legends game mode, such as Classic, /// League of Legends game mode, such as Classic,
/// ARAM, URF, One For All, Ascension, etc. /// ARAM, URF, One For All, Ascension, etc.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Hash)] #[derive(Eq, PartialEq, Hash)]
#[derive(EnumString, Display, AsRefStr, IntoStaticStr)] #[derive(EnumString, Display, AsRefStr, IntoStaticStr)]

View File

@ -9,7 +9,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
/// League of Legends maps. /// League of Legends maps.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)] #[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -13,7 +13,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
/// League of Legends matchmaking queue. /// League of Legends matchmaking queue.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq)] #[derive(Eq, PartialEq)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -7,7 +7,7 @@ use serde_repr::{ Serialize_repr, Deserialize_repr };
use num_enum::{ IntoPrimitive, TryFromPrimitive }; use num_enum::{ IntoPrimitive, TryFromPrimitive };
/// League of Legends matchmaking seasons. /// League of Legends matchmaking seasons.
#[non_exhaustive] #[cfg_attr(feature = "nightly", non_exhaustive)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
#[derive(Eq, PartialEq, Hash, PartialOrd, Ord)] #[derive(Eq, PartialEq, Hash, PartialOrd, Ord)]
#[derive(Serialize_repr, Deserialize_repr)] #[derive(Serialize_repr, Deserialize_repr)]

View File

@ -1,5 +1,5 @@
#![feature(custom_test_frameworks)] #![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
#![test_runner(my_runner)] #![cfg_attr(feature = "nightly", test_runner(my_runner))]
fn my_runner(_: &[()]) { main() } fn my_runner(_: &[()]) { main() }
use riven::RiotApi; use riven::RiotApi;

View File

@ -1,5 +1,5 @@
#![feature(custom_test_frameworks)] #![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
#![test_runner(my_runner)] #![cfg_attr(feature = "nightly", test_runner(my_runner))]
mod async_tests; mod async_tests;
mod testutils; mod testutils;

View File

@ -1,5 +1,5 @@
#![feature(custom_test_frameworks)] #![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
#![test_runner(my_runner)] #![cfg_attr(feature = "nightly", test_runner(my_runner))]
mod async_tests; mod async_tests;
mod testutils; mod testutils;

View File

@ -1,6 +1,6 @@
#![feature(custom_test_frameworks)] #![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
#![feature(async_closure)] #![feature(async_closure)]
#![test_runner(my_runner)] #![cfg_attr(feature = "nightly", test_runner(my_runner))]
mod async_tests; mod async_tests;
mod testutils; mod testutils;

View File

@ -1,5 +1,5 @@
#![feature(custom_test_frameworks)] #![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
#![test_runner(my_runner)] #![cfg_attr(feature = "nightly", test_runner(my_runner))]
mod async_tests; mod async_tests;
mod testutils; mod testutils;

View File

@ -1,5 +1,5 @@
#![feature(custom_test_frameworks)] #![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
#![test_runner(my_runner)] #![cfg_attr(feature = "nightly", test_runner(my_runner))]
mod async_tests; mod async_tests;
mod testutils; mod testutils;