From 5ce511c5a72224898c5c20d82807152d1833fcf8 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Fri, 23 Jul 2021 01:50:47 +0700 Subject: [PATCH] Refactor `main.rs` to use `if let` construction --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 604053c..7f15ba3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,8 +7,7 @@ fn main() { let args: Vec = env::args().collect(); let filename = &args[1]; let config = unreal_config::load_file(Path::new(filename)); - match config { - Ok(config) => print!("{}", config), - _ => (), + if let Ok(config) = config { + print!("{}", config); } }