Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
jeffs committed Dec 11, 2023
1 parent d947fb2 commit 7d2707d
Showing 2 changed files with 0 additions and 32 deletions.
31 changes: 0 additions & 31 deletions 2023/day10/src/grid.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(dead_code)]

use crate::{direction::Direction, position::Position, tile::Tile};

#[derive(Clone)]
@@ -68,14 +66,6 @@ impl Grid {
})
}

pub fn enumerate_mut(&mut self) -> impl Iterator<Item = (Position, &mut Tile)> + '_ {
self.0.iter_mut().enumerate().flat_map(|(i, row)| {
row.iter_mut()
.enumerate()
.map(move |(j, tile)| (Position(i, j), tile))
})
}

pub fn expand(self) -> Grid {
Grid(
self.0
@@ -86,27 +76,6 @@ impl Grid {
)
}

pub fn collapse(self) -> Grid {
Grid(
self.0
.into_iter()
.enumerate()
.flat_map(|(i, row)| {
(i % 2 == 0).then(|| {
row.into_iter()
.enumerate()
.flat_map(|(j, tile)| (j % 2 == 0).then_some(tile))
.collect()
})
})
.collect(),
)
}

pub fn iter(&self) -> impl Iterator<Item = Tile> + '_ {
self.0.iter().flat_map(|row| row.iter()).cloned()
}

pub fn height(&self) -> usize {
self.0.len()
}
1 change: 0 additions & 1 deletion 2023/day10/src/tile.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
use crate::direction::Direction;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]

0 comments on commit 7d2707d

Please sign in to comment.