diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-04-12 00:08:03 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-04-12 00:08:03 -0400 |
commit | 236f06736e45c2a70f43589c9d447a0a3ef240b5 (patch) | |
tree | c390d4cbfec5223ac1aefe3947f8e1bb885757d2 /src/pinentry.rs | |
parent | 91d1d1890bdc3ee75b69e00d5368c5b29a4f461c (diff) | |
download | rbw-236f06736e45c2a70f43589c9d447a0a3ef240b5.tar.gz rbw-236f06736e45c2a70f43589c9d447a0a3ef240b5.zip |
improve error handling and reporting
Diffstat (limited to 'src/pinentry.rs')
-rw-r--r-- | src/pinentry.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pinentry.rs b/src/pinentry.rs index 4a2196e..769b8d0 100644 --- a/src/pinentry.rs +++ b/src/pinentry.rs @@ -17,6 +17,8 @@ pub async fn getpin( opts }; let mut child = opts.spawn().context(crate::error::Spawn)?; + // unwrap is safe because we specified stdin as piped in the command opts + // above let mut stdin = child.stdin.take().unwrap(); stdin @@ -39,6 +41,8 @@ pub async fn getpin( let mut buf = crate::locked::Vec::new(); buf.extend(std::iter::repeat(0)); + // unwrap is safe because we specified stdout as piped in the command opts + // above let len = read_password(buf.data_mut(), child.stdout.as_mut().unwrap()).await?; buf.truncate(len); |