diff options
Diffstat (limited to 'src/tasks.rs')
| -rw-r--r-- | src/tasks.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/tasks.rs b/src/tasks.rs index 1793091..3c49c7a 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -35,10 +35,7 @@ fn exec(cmds: &[String]) -> Result<String, String> { fn network(switch: &[String]) -> Result<String, String> { use std::process::{Command, Stdio}; - let switch: bool = match switch[0].parse() { - Ok(s) => s, - Err(e) => return Err(e.to_string()), - }; + let switch: bool = switch[0].parse::<bool>().map_err(|e| e.to_string())?; // TODO: windows and linux |
