Upgrade to reqwest 0.11, tokio 1.0

This commit is contained in:
Mingwei Samuel 2021-01-05 14:17:23 -08:00
parent 4782ba48b3
commit 20b8d49b89
3 changed files with 12 additions and 13 deletions

View file

@ -25,19 +25,19 @@ nightly = [ "parking_lot/nightly" ]
[dependencies]
lazy_static = "1.4"
log = "0.4"
num_enum = "0.4"
parking_lot = "0.10"
reqwest = { version = "0.10", features = [ "gzip", "json" ] }
num_enum = "0.5"
parking_lot = "0.11"
reqwest = { version = "0.11", features = [ "gzip", "json" ] }
scan_fmt = { version = "0.2", default-features = false }
serde = { version = "1.0", features = [ "derive" ] }
serde_repr = "0.1"
strum = "0.17"
strum_macros = "0.17"
tokio = { version = "0.2", default-features = false, features = [ "time" ] }
url = "2.1"
strum = "0.20"
strum_macros = "0.20"
tokio = { version = "1", default-features = false, features = [ "time" ] }
url = "2"
[dev-dependencies]
colored = "1.8"
env_logger = "0.7"
colored = "2"
env_logger = "0.8"
fake_instant = "0.4"
tokio = "0.2"
tokio = { version = "1", default-features = false, features = [ "rt-multi-thread" ] }

View file

@ -3,7 +3,6 @@ use std::sync::Arc;
use log;
use reqwest::{ Client, StatusCode, Url };
use tokio::time::delay_for;
use crate::Result;
use crate::ResponseInfo;
@ -54,7 +53,7 @@ impl RegionalRequester {
// Rate limiting.
while let Some(delay) = RateLimit::get_both_or_delay(&self.app_rate_limit, &*method_rate_limit) {
delay_for(delay).await;
tokio::time::sleep(delay).await;
}
// Send request.

View file

@ -7,7 +7,7 @@ macro_rules! async_tests {
env_logger::init();
std::process::exit({
let mut rt = tokio::runtime::Runtime::new()
let rt = tokio::runtime::Runtime::new()
.expect("Failed to create runtime.");
let (_, errs) = rt.block_on(async {