cleanup some clippy warnings
This commit is contained in:
3 files changed
+11
-12
No files matched your search
+2
-2
@@ -35,8 +35,8 @@ fn follow_course_better(s: &str) -> i32 {
|
||||
pub(crate) fn run() -> Result<(usize, usize)> {
|
||||
let input = include_str!("../data/day02.txt");
|
||||
Ok((
|
||||
follow_course(&input) as usize,
|
||||
follow_course_better(&input) as usize,
|
||||
follow_course(input) as usize,
|
||||
follow_course_better(input) as usize,
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
+5
-6
@@ -89,7 +89,7 @@ fn diagnose_lifesupport(s: &str) -> usize {
|
||||
|
||||
pub(crate) fn run() -> Result<(usize, usize)> {
|
||||
let input = include_str!("../data/day03.txt");
|
||||
Ok((diagnose_power(&input), diagnose_lifesupport(&input)))
|
||||
Ok((diagnose_power(input), diagnose_lifesupport(input)))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -99,15 +99,14 @@ mod tests {
|
||||
#[test]
|
||||
fn test_example() {
|
||||
let input = include_str!("../data/day03-test.txt");
|
||||
assert_eq!(diagnose_power(&input), 198);
|
||||
assert_eq!(diagnose_lifesupport(&input), 230);
|
||||
assert_eq!(diagnose_power(input), 198);
|
||||
assert_eq!(diagnose_lifesupport(input), 230);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_my_data() {
|
||||
let input = include_str!("../data/day03.txt");
|
||||
assert_eq!(diagnose_power(&input), 4191876);
|
||||
// assert_eq!(follow_course(&input), 2070300);
|
||||
// assert_eq!(follow_course_better(&input), 2078985210);
|
||||
assert_eq!(diagnose_power(input), 4191876);
|
||||
assert_eq!(diagnose_lifesupport(input), 3414905);
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -82,14 +82,14 @@ mod tests {
|
||||
#[test]
|
||||
fn test_example() {
|
||||
let input = include_str!("../data/day04-test.txt");
|
||||
assert_eq!(find_winning_score(&input, true), 4512);
|
||||
assert_eq!(find_winning_score(&input, false), 1924);
|
||||
assert_eq!(find_winning_score(input, true), 4512);
|
||||
assert_eq!(find_winning_score(input, false), 1924);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_my_data() {
|
||||
let input = include_str!("../data/day04.txt");
|
||||
assert_eq!(find_winning_score(&input, true), 71708);
|
||||
assert_eq!(find_winning_score(&input, false), 34726);
|
||||
assert_eq!(find_winning_score(input, true), 71708);
|
||||
assert_eq!(find_winning_score(input, false), 34726);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user