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
This commit is contained in:
andypymont 2023-02-04 22:09:46 +00:00
parent c49631fada
commit fe56f7fb2d

View file

@ -54,12 +54,9 @@ fn create_file(path: &str) -> Result<File, std::io::Error> {
}
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}");