Skip to content

Commit

Permalink
Change unimplemented to unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Nov 26, 2023
1 parent d2e8a35 commit 2700cca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 {
Expand Down

0 comments on commit 2700cca

Please sign in to comment.