diff --git a/Cargo.toml b/Cargo.toml index fb0f6252..b85a2f62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,6 @@ __rustls = ["dep:rustls"] [dependencies] async-trait = "^0.1" base64 = "0.22" -futures = "0.3" http = "1" http-body-util = "0.1" hyper = "1" diff --git a/src/authenticator.rs b/src/authenticator.rs index ed7bd8a2..bccd4412 100644 --- a/src/authenticator.rs +++ b/src/authenticator.rs @@ -22,7 +22,6 @@ use private::AuthFlow; use crate::access_token::AccessTokenFlow; -use futures::lock::Mutex; use hyper_util::client::legacy::connect::Connect; use std::borrow::Cow; use std::fmt; @@ -30,6 +29,7 @@ use std::io; use std::path::PathBuf; use std::sync::Arc; use std::time::Duration; +use tokio::sync::Mutex; struct InnerAuthenticator where diff --git a/src/client.rs b/src/client.rs index 63fe3f6e..96643a00 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,7 +1,6 @@ //! Module containing the HTTP client used for sending requests use std::time::Duration; -use futures::TryFutureExt; use http::Uri; use hyper_util::client::legacy::{connect::Connect, Error as LegacyHyperError}; #[cfg(all(feature = "aws-lc-rs", feature = "hyper-rustls", not(feature = "ring")))] @@ -101,11 +100,9 @@ where async fn request(&self, payload: http::Request) -> Result { let future = self.client.request(payload); match self.timeout { - Some(duration) => { - tokio::time::timeout(duration, future) - .map_err(|_| SendError::Timeout) - .await? - } + Some(duration) => tokio::time::timeout(duration, future) + .await + .map_err(|_| SendError::Timeout)?, None => future.await, } .map_err(SendError::Hyper) diff --git a/src/installed.rs b/src/installed.rs index 4afab09b..c90d01d9 100644 --- a/src/installed.rs +++ b/src/installed.rs @@ -7,7 +7,6 @@ use crate::client::SendRequest; use crate::error::Error; use crate::types::{ApplicationSecret, TokenInfo}; -use futures::lock::Mutex; use http_body_util::BodyExt; use std::convert::AsRef; use std::net::SocketAddr; @@ -15,7 +14,7 @@ use std::sync::Arc; use http::header; use percent_encoding::{percent_encode, AsciiSet, CONTROLS}; -use tokio::sync::oneshot; +use tokio::sync::{oneshot, Mutex}; use url::form_urlencoded; const QUERY_SET: AsciiSet = CONTROLS.add(b' ').add(b'"').add(b'#').add(b'<').add(b'>'); @@ -349,10 +348,9 @@ impl InstalledFlowServer { } mod installed_flow_server { - use futures::lock::Mutex; use http::{Request, Response, StatusCode, Uri}; use std::sync::Arc; - use tokio::sync::oneshot; + use tokio::sync::{oneshot, Mutex}; use url::form_urlencoded; pub(super) async fn handle_req( diff --git a/src/storage.rs b/src/storage.rs index f4302a3a..3312b575 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -4,11 +4,11 @@ // pub use crate::types::TokenInfo; -use futures::lock::Mutex; use std::collections::HashMap; use std::io; use std::path::{Path, PathBuf}; use thiserror::Error; +use tokio::sync::Mutex; use async_trait::async_trait;