From e1a485a0441ef26090b8bc97b3f05aecd62fbb8a Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Fri, 23 Oct 2020 02:21:44 +0200 Subject: minor changes --- mumctl/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mumctl') diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index 902f03a..49e5662 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -165,9 +165,12 @@ fn main() { if !config::cfg_exists() { println!("Config file not found. Create one in {}? [Y/n]", config::get_creatable_cfg_path()); let stdin = std::io::stdin(); - let response = stdin.lock().lines().next().unwrap().unwrap(); - if &response == "Y" { - config.write_default_cfg(true).unwrap(); + let response = stdin.lock().lines().next(); + match response.map(|e| e.map(|e| &e == "Y")) { + Some(Ok(true)) => { + config.write_default_cfg(true).unwrap(); + } + _ => {}, } } else { config.write_default_cfg(false).unwrap(); -- cgit v1.2.1