Resolve clippy::must_use_candidate warnings

- See https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
This commit is contained in:
andypymont 2023-02-04 22:18:46 +00:00
parent ec755704b2
commit 43db90c6ec
2 changed files with 5 additions and 1 deletions

View file

@ -8,10 +8,12 @@ use std::{
process,
};
const MODULE_TEMPLATE: &str = r###"pub fn part_one(input: &str) -> Option<u32> {
const MODULE_TEMPLATE: &str = r###"#[must_use]
pub fn part_one(input: &str) -> Option<u32> {
None
}
#[must_use]
pub fn part_two(input: &str) -> Option<u32> {
None
}

View file

@ -41,6 +41,7 @@ macro_rules! solve {
}};
}
#[must_use]
pub fn read_file(folder: &str, day: u8) -> String {
let cwd = env::current_dir().unwrap();
@ -54,6 +55,7 @@ fn parse_time(val: &str, postfix: &str) -> f64 {
val.split(postfix).next().unwrap().parse().unwrap()
}
#[must_use]
pub fn parse_exec_time(output: &str) -> f64 {
output.lines().fold(0_f64, |acc, l| {
if l.contains("elapsed:") {