diff options
author | Stephan Sokolow <http://www.ssokolow.com/ContactMe> | 2019-10-24 20:44:39 -0400 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-10-25 22:33:03 +0200 |
commit | 9273f3f45f7418e87b6e53baef78612ef0d6c5e7 (patch) | |
tree | b28dad7e08dcd45cfa53337cd5bd5b50fa6a6472 /src/backends/dialog.rs | |
parent | 9a2e1124bc97a003ad8916a17653ff2d1fa4250d (diff) | |
download | dialog-rs-9273f3f45f7418e87b6e53baef78612ef0d6c5e7.tar.gz dialog-rs-9273f3f45f7418e87b6e53baef78612ef0d6c5e7.tar.bz2 |
Fix clippy complaints that don't change the semantics
(Clippy also complains about `new()` without `impl Default`)
Diffstat (limited to 'src/backends/dialog.rs')
-rw-r--r-- | src/backends/dialog.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/backends/dialog.rs b/src/backends/dialog.rs index e681caf..85b0294 100644 --- a/src/backends/dialog.rs +++ b/src/backends/dialog.rs @@ -111,19 +111,17 @@ fn get_choice(status: process::ExitStatus) -> Result<Choice> { fn get_stderr(output: process::Output) -> Result<Option<String>> { if output.status.success() { String::from_utf8(output.stderr) - .map(|s| Some(s)) - .map_err(|err| Error::from(err)) - } else { - if let Some(code) = output.status.code() { - match code { - 0 => Ok(None), - 1 => Ok(None), - 255 => Ok(None), - _ => Err(Error::from(("dialog", output.status))), - } - } else { - Err(Error::from(("dialog", output.status))) + .map(Some) + .map_err(Error::from) + } else if let Some(code) = output.status.code() { + match code { + 0 => Ok(None), + 1 => Ok(None), + 255 => Ok(None), + _ => Err(Error::from(("dialog", output.status))), } + } else { + Err(Error::from(("dialog", output.status))) } } |