From 236f06736e45c2a70f43589c9d447a0a3ef240b5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 12 Apr 2020 00:08:03 -0400 Subject: improve error handling and reporting --- src/pinentry.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pinentry.rs') 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); -- cgit v1.2.3-54-g00ecf