From 600169f0bb0798007b59c18d0342091f1d952d6d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 11 Jul 2020 20:09:09 -0400 Subject: clippy --- src/actions.rs | 10 ++++++---- src/api.rs | 2 +- src/pinentry.rs | 5 ++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/actions.rs b/src/actions.rs index f77378e..bda8670 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -275,10 +275,12 @@ async fn with_exchange_refresh_token_async( ) -> Result<(Option, T)> where F: Fn( - &str, - ) -> std::pin::Pin< - Box> + Send>, - >, + &str, + ) -> std::pin::Pin< + Box> + Send>, + > + Send + + Sync, + T: Send, { match f(access_token).await { Ok(t) => Ok((None, t)), diff --git a/src/api.rs b/src/api.rs index aec1398..6ee77ca 100644 --- a/src/api.rs +++ b/src/api.rs @@ -173,7 +173,7 @@ impl SyncResCipher { username: login.username.clone(), password: login.password.clone(), uris: login.uris.as_ref().map_or_else( - || vec![], + std::vec::Vec::new, |uris| { uris.iter() .filter_map(|uri| uri.uri.clone()) diff --git a/src/pinentry.rs b/src/pinentry.rs index a215547..b9b3b11 100644 --- a/src/pinentry.rs +++ b/src/pinentry.rs @@ -75,7 +75,10 @@ async fn read_password< mut ncommands: u8, data: &mut [u8], mut r: R, -) -> Result { +) -> Result +where + R: Send, +{ let mut len = 0; loop { let nl = data.iter().take(len).position(|c| *c == b'\n'); -- cgit v1.2.3-54-g00ecf