🎨 Day 4: Formatting

This commit is contained in:
LeMoonStar 2024-12-04 07:48:48 +01:00
parent 11b61a2527
commit bb4c059b25

View file

@ -13,7 +13,7 @@ enum Direction {
NorthEast,
NorthWest,
SouthEast,
SouthWest
SouthWest,
}
#[derive(Debug, Clone)]
@ -31,6 +31,7 @@ impl LetterWall {
}
fn is_upper_left_of_xmas(&self, x: usize, y: usize) -> Option<Direction> {
#[rustfmt::skip]
match(
self.at( x, y), self.at( x+1, y), self.at( x+2, y), self.at( x+3, y),
self.at( x, y+1), self.at( x+1, y+1), self.at( x+2, y+1), self.at( x+3, y+1),
@ -105,12 +106,7 @@ impl LetterWall {
impl From<&str> for LetterWall {
fn from(value: &str) -> Self {
Self (
value
.lines()
.map(|v| v.chars().collect())
.collect()
)
Self(value.lines().map(|v| v.chars().collect()).collect())
}
}
@ -126,10 +122,7 @@ impl DayImpl<Data> for Day<CURRENT_DAY> {
}
fn init(input: &str) -> (Self, Data) {
(
Self {},
input.into(),
)
(Self {}, input.into())
}
fn one(&self, data: &mut Data) -> Answer {