fix: fix clippy lint

This commit is contained in:
Felix Spöttel 2022-10-29 17:18:58 +02:00
parent aae6a8f029
commit e327f00aa8
3 changed files with 21 additions and 6 deletions

View File

@ -1,2 +1,4 @@
// Use this file if you want to extract sections of your solutions.
// Example import: `use aoc::helpers::example_fn;`
/*
* Use this file if you want to extract helpers from your solutions.
* Example import from this file: `use aoc::helpers::example_fn;`
*/

View File

@ -1,5 +1,7 @@
// This file contains template helpers.
// Prefer `./helpers.rs` if you want to extract code from your solutions.
/*
* This file contains template helpers.
* Prefer `./helpers.rs` if you want to extract code from your solutions.
*/
use std::env;
use std::fs;
@ -26,7 +28,7 @@ macro_rules! solve {
"{} {}(elapsed: {:.2?}){}",
result, ANSI_ITALIC, elapsed, ANSI_RESET
);
},
}
None => {
println!("not solved.")
}

View File

@ -1,3 +1,7 @@
/*
* This file contains template code.
* Unless you want to change how solutions are invoked, this file does not need to be edited.
*/
use aoc::{ANSI_BOLD, ANSI_ITALIC, ANSI_RESET};
use std::process::Command;
@ -18,7 +22,14 @@ fn main() {
let output = String::from_utf8(cmd.stdout).unwrap();
let is_empty = output.is_empty();
println!("{}", if is_empty { "Not solved." } else { &output.trim() });
println!(
"{}",
if is_empty {
"Not solved."
} else {
output.trim()
}
);
if is_empty {
0_f64