Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-dupre committed Feb 23, 2025
1 parent d8ef805 commit 06fe597
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
19 changes: 19 additions & 0 deletions opening-hours-syntax/src/tests/rubik.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ fn test_pop_disjoint() {
// 5 ⋅ A ⋅ ⋅ B B B ⋅
// 6 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
let mut grid = grid_empty.clone();

grid.set(
&EmptyPavingSelector.dim([1..2, 4..7]).dim_front([3..6]),
true,
Expand All @@ -83,3 +84,21 @@ fn test_pop_disjoint() {
assert_eq!(grid, grid_empty);
assert_eq!(grid.pop_selector(true), None);
}

#[test]
fn test_debug() {
// 0 1 2 3 4 5 6 7
// 2 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
// 3 ⋅ A ⋅ ⋅ B B B ⋅
// 4 ⋅ A ⋅ ⋅ B B B ⋅
// 5 ⋅ A ⋅ ⋅ B B B ⋅
// 6 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
let mut grid = Paving2D::default();

grid.set(
&EmptyPavingSelector.dim([1..2, 4..7]).dim_front([3..6]),
true,
);

assert_eq!(&format!("{grid:?}"), "Dim { [3, 6[: Dim { [1, 2[: Cell { inner: true }, [2, 4[: Cell { inner: false }, [4, 7[: Cell { inner: true } } }")
}
16 changes: 0 additions & 16 deletions opening-hours/src/utils/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@ impl<D> DateTimeRange<D> {
) -> Self {
Self { range, kind, comments }
}

pub fn map_dates<D2>(self, mut map: impl FnMut(D) -> D2) -> DateTimeRange<D2> {
DateTimeRange {
range: map(self.range.start)..map(self.range.end),
kind: self.kind,
comments: self.comments,
}
}

pub fn comments(&self) -> &[Arc<str>] {
&self.comments
}

pub fn into_comments(self) -> UniqueSortedVec<Arc<str>> {
self.comments
}
}

// WrappingRange
Expand Down

0 comments on commit 06fe597

Please sign in to comment.