Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ 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;
use std::io;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::Mutex;

struct InnerAuthenticator<C>
where
Expand Down
9 changes: 3 additions & 6 deletions src/client.rs
Original file line number Diff line number Diff line change
@@ -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")))]
Expand Down Expand Up @@ -101,11 +100,9 @@ where
async fn request(&self, payload: http::Request<String>) -> Result<HyperResponse, SendError> {
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)
Expand Down
6 changes: 2 additions & 4 deletions src/installed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ 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;
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'>');
Expand Down Expand Up @@ -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<B: hyper::body::Body>(
Expand Down
2 changes: 1 addition & 1 deletion src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down