diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-02-18 15:38:43 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-02-18 15:49:17 -0500 |
commit | 1d68b717e8ae12dfdf8af9c451dbf0d6a8cc6d71 (patch) | |
tree | 9416fd8d1bc125aa6f217d6cbc6340e27655bb99 /src/pinentry.rs | |
parent | c6a948a5cfa2783907c084cc8d1034c33db319e6 (diff) | |
download | rbw-1d68b717e8ae12dfdf8af9c451dbf0d6a8cc6d71.tar.gz rbw-1d68b717e8ae12dfdf8af9c451dbf0d6a8cc6d71.zip |
clippy
Diffstat (limited to 'src/pinentry.rs')
-rw-r--r-- | src/pinentry.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/pinentry.rs b/src/pinentry.rs index ce1227f..d3bf65a 100644 --- a/src/pinentry.rs +++ b/src/pinentry.rs @@ -34,18 +34,18 @@ pub async fn getpin( .map_err(|source| Error::WriteStdin { source })?; ncommands += 1; stdin - .write_all(format!("SETPROMPT {}\n", prompt).as_bytes()) + .write_all(format!("SETPROMPT {prompt}\n").as_bytes()) .await .map_err(|source| Error::WriteStdin { source })?; ncommands += 1; stdin - .write_all(format!("SETDESC {}\n", desc).as_bytes()) + .write_all(format!("SETDESC {desc}\n").as_bytes()) .await .map_err(|source| Error::WriteStdin { source })?; ncommands += 1; if let Some(err) = err { stdin - .write_all(format!("SETERROR {}\n", err).as_bytes()) + .write_all(format!("SETERROR {err}\n").as_bytes()) .await .map_err(|source| Error::WriteStdin { source })?; ncommands += 1; @@ -77,15 +77,13 @@ pub async fn getpin( Ok(crate::locked::Password::new(buf)) } -async fn read_password< - R: tokio::io::AsyncRead + tokio::io::AsyncReadExt + Unpin, ->( +async fn read_password<R>( mut ncommands: u8, data: &mut [u8], mut r: R, ) -> Result<usize> where - R: Send, + R: tokio::io::AsyncRead + tokio::io::AsyncReadExt + Unpin + Send, { let mut len = 0; loop { @@ -120,7 +118,7 @@ where }); } return Err(Error::PinentryErrorMessage { - error: format!("unknown error ({})", code), + error: format!("unknown error ({code})"), }); } None => { |