From 4026d92cf6f4cd0b310b4a83e403995bc47a42ef Mon Sep 17 00:00:00 2001 From: Maxime Bedard Date: Thu, 12 Nov 2020 20:31:19 -0500 Subject: [PATCH] Bump to tokio 0.3 and hyper 0.14 --- Cargo.toml | 10 +++++----- src/device.rs | 2 +- tests/tests.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cd6c2d1..e4384a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,20 +14,20 @@ edition = "2018" base64 = "0.12" chrono = { version = "0.4", features = ["serde"] } http = "0.2" -hyper = "0.13.5" -hyper-rustls = "0.20" +hyper = { git = "https://github.com/hyperium/hyper" } +hyper-rustls = { git = "https://github.com/messense/hyper-rustls", branch = "tokio-0-3" } log = "0.4" -rustls = "0.17" +rustls = "0.18" seahash = "4" serde = {version = "1.0", features = ["derive"]} serde_json = "1.0" -tokio = { version = "0.2", features = ["fs", "macros", "io-std", "time"] } +tokio = { version = "0.3", features = ["fs", "macros", "io-std", "io-util", "time", "sync", "rt"] } url = "2" percent-encoding = "2" futures = "0.3" [dev-dependencies] -httptest = "0.11.1" +httptest = { git = "https://github.com/maximebedard/httptest", branch = "bump-tokio-hyper" } env_logger = "0.7" tempfile = "3.1" diff --git a/src/device.rs b/src/device.rs index 5378494..8ce33e7 100644 --- a/src/device.rs +++ b/src/device.rs @@ -80,7 +80,7 @@ impl DeviceFlow { let mut interval = device_auth_resp.interval; log::debug!("Polling every {:?} for device token", interval); loop { - tokio::time::delay_for(interval).await; + tokio::time::sleep(interval).await; interval = match Self::poll_token( &app_secret, hyper_client, diff --git a/tests/tests.rs b/tests/tests.rs index 3e6558e..5d39b11 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -10,7 +10,7 @@ use std::future::Future; use std::path::PathBuf; use std::pin::Pin; -use httptest::{mappers::*, responders::json_encoded, Expectation, Server}; +use httptest::{matchers::*, responders::json_encoded, Expectation, Server}; use hyper::client::connect::HttpConnector; use hyper::Uri; use hyper_rustls::HttpsConnector;