From 8e28b0b3d644817d034b1b91308d0d87376ac434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20L=C3=A4ufer?= Date: Fri, 22 Mar 2024 18:38:02 -0500 Subject: [PATCH] further simplification of day 1 --- src/bin/day1.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/day1.rs b/src/bin/day1.rs index 1701cab..968b5cf 100644 --- a/src/bin/day1.rs +++ b/src/bin/day1.rs @@ -10,7 +10,7 @@ fn main() -> io::Result<()> { fn run_calibration(label: &str, file_name: &str, digits: &[String]) -> io::Result<()> { let file = File::open("data/".to_string() + file_name)?; - let lines = BufReader::new(file).lines().collect::>>()?; + let lines = BufReader::new(file).lines().collect::>>()?; println!("Day 1 {} solution: {}", label, calibrate_lines(&lines, digits)); Ok(()) } @@ -91,7 +91,7 @@ fn test_part_1() { "pqr3stu8vwx", "a1b2c3d4e5f", "treb7uchet", - ].map(str::to_string).to_vec(); + ].map(str::to_string); assert_eq!(calibrate_lines(&example, &SIMPLE_DIGITS), 142); } @@ -105,6 +105,6 @@ fn test_part_2() { "4nineeightseven2", "zoneight234", "7pqrstsixteen", - ].map(str::to_string).to_vec(); + ].map(str::to_string); assert_eq!(calibrate_lines(&example, &ALL_DIGITS), 281); }