From fe56f7fb2dd9e77ed75a4257c586f77fe0005478 Mon Sep 17 00:00:00 2001 From: andypymont Date: Sat, 4 Feb 2023 22:09:46 +0000 Subject: [PATCH] Resolve clippy::single-match-else warnings - See https://rust-lang.github.io/rust-clippy/master/index.html#single_match_else - Also avoid introducing a clippy::manual-let-else warning in the process --- src/bin/scaffold.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/bin/scaffold.rs b/src/bin/scaffold.rs index 2d04737..c63f2d3 100644 --- a/src/bin/scaffold.rs +++ b/src/bin/scaffold.rs @@ -54,12 +54,9 @@ fn create_file(path: &str) -> Result { } fn main() { - let day = match parse_args() { - Ok(day) => day, - Err(_) => { - eprintln!("Need to specify a day (as integer). example: `cargo scaffold 7`"); - process::exit(1); - } + let Ok(day) = parse_args() else { + eprintln!("Need to specify a day (as integer). example: `cargo scaffold 7`"); + process::exit(1); }; let day_padded = format!("{day:02}");