Browse Source

Refactor `main.rs` to use `if let` construction

feature_link
Anton Tarasenko 3 years ago
parent
commit
5ce511c5a7
  1. 5
      src/main.rs

5
src/main.rs

@ -7,8 +7,7 @@ fn main() {
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
let filename = &args[1]; let filename = &args[1];
let config = unreal_config::load_file(Path::new(filename)); let config = unreal_config::load_file(Path::new(filename));
match config { if let Ok(config) = config {
Ok(config) => print!("{}", config), print!("{}", config);
_ => (),
} }
} }

Loading…
Cancel
Save