From 2700ccabab212f0b4e21475fe85c143689cc503f Mon Sep 17 00:00:00 2001 From: Connor Slade Date: Sun, 26 Nov 2023 12:52:46 -0500 Subject: [PATCH] Change unimplemented to unreachable --- common/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index 64d82ad..6629f4d 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -10,10 +10,13 @@ pub trait Solution { } } +/// Load the input for the given year and day. +/// Removes carriage returns and trims leading and trailing whitespace. pub fn load(year: u32, day: u32) -> String { load_raw(year, day).trim().replace('\r', "") } +/// Load the input for the given year and day. pub fn load_raw(year: u32, day: u32) -> String { let file = format!("data/{year}/{:02}.txt", day); fs::read_to_string(&file).unwrap_or_else(|_| panic!("Error reading file {}", file)) @@ -23,15 +26,15 @@ pub struct DummySolution; impl Solution for DummySolution { fn name(&self) -> &'static str { - unimplemented!() + unreachable!() } fn part_a(&self) -> String { - unimplemented!() + unreachable!() } fn part_b(&self) -> String { - unimplemented!() + unreachable!() } fn is_dummy(&self) -> bool {