From 000000103182bea6c9553676fa32230b8d84646e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Tue, 24 Jan 2023 21:38:41 +0100 Subject: [PATCH] feat: fixup template errors --- src/bin/scaffold.rs | 4 ++-- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/scaffold.rs b/src/bin/scaffold.rs index ab5a6b0..9b994ec 100644 --- a/src/bin/scaffold.rs +++ b/src/bin/scaffold.rs @@ -24,12 +24,12 @@ mod tests { use super::*; #[test] fn test_part_one() { - let input = aoc::read_file("examples", DAY).trim(); + let input = aoc::read_file("examples", DAY); assert_eq!(part_one(&input), None); } #[test] fn test_part_two() { - let input = aoc::read_file("examples", DAY).trim(); + let input = aoc::read_file("examples", DAY); assert_eq!(part_two(&input), None); } } diff --git a/src/lib.rs b/src/lib.rs index ac7d221..052dfd3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,7 @@ pub fn read_file(folder: &str, day: u8) -> String { let filepath = cwd.join("src").join(folder).join(format!("{day:02}.txt")); let f = fs::read_to_string(filepath); - f.expect("could not open input file") + f.expect("could not open input file").trim().to_string() } fn parse_time(val: &str, postfix: &str) -> f64 {