diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-19 10:19:08 -0400 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2019-05-19 10:30:40 -0400 |
commit | e84df119299652db39ebfa6a6c3a683b17a76b04 (patch) | |
tree | 282679594b7445780c8c53f68c38fbe4593b98ca /src/unix.rs | |
parent | 9c3d4d94745161ee97a365a5c803c3084d2f7823 (diff) |
make use of serde default where possible
- update other code to be consistent with changes
Diffstat (limited to 'src/unix.rs')
-rw-r--r-- | src/unix.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/unix.rs b/src/unix.rs index 8f7135b..c8b0947 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -71,7 +71,7 @@ pub fn open_with_entry(paths: &[PathBuf], entry: &mimetype::JoshutoMimetypeEntry let program = entry.program.clone(); let mut command = process::Command::new(program); - if let Some(true) = entry.silent { + if entry.silent { command.stdout(process::Stdio::null()); command.stderr(process::Stdio::null()); } @@ -82,13 +82,14 @@ pub fn open_with_entry(paths: &[PathBuf], entry: &mimetype::JoshutoMimetypeEntry command.args(paths.iter().map(|path| path.as_os_str())); match command.spawn() { - Ok(mut handle) => match entry.fork { - Some(true) => {} - _ => match handle.wait() { - Ok(_) => {} - Err(e) => eprintln!("{}", e), - }, - }, + Ok(mut handle) => { + if entry.fork { + match handle.wait() { + Ok(_) => {} + Err(e) => eprintln!("{}", e), + } + } + } Err(e) => eprintln!("{}", e), }; } |