diff --git a/src/range_bounds_map.rs b/src/range_bounds_map.rs index ffd2e27..acd62b5 100644 --- a/src/range_bounds_map.rs +++ b/src/range_bounds_map.rs @@ -648,9 +648,9 @@ where /// iterator of the full or partial `RangeBounds` that were cut in /// as `((Bound, Bound), Value)`. /// - /// If the remaining `RangeBounds` left in the map after the cut - /// are not able be created with the [`TryFromBounds`] trait then - /// a [`TryFromBoundsError`] will be returned. + /// If the remaining `RangeBounds` left in the map after the cut + /// are not able be created with the [`TryFromBounds`] trait then + /// a [`TryFromBoundsError`] will be returned. /// /// `V` must implement `Clone` as if you try to cut out the center /// of a `RangeBounds` in the map it will split into two different @@ -1687,6 +1687,25 @@ mod tests { pub(crate) const NUMBERS_DOMAIN: &'static [u8] = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + fn basic() -> RangeBoundsMap { + RangeBoundsMap::try_from([ + (ui(4), false), + (ee(5, 7), true), + (ii(7, 7), false), + (ie(14, 16), true), + ]) + .unwrap() + } + + fn special() -> RangeBoundsMap { + RangeBoundsMap::try_from([ + (mii(4, 6), false), + (mee(7, 8), true), + (mii(8, 12), false), + ]) + .unwrap() + } + #[derive(Debug, PartialEq, Clone)] enum MultiBounds { Inclusive(u8, u8), @@ -1920,16 +1939,6 @@ mod tests { } } - fn basic() -> RangeBoundsMap { - RangeBoundsMap::try_from([ - (ui(4), false), - (ee(5, 7), true), - (ii(7, 7), false), - (ie(14, 16), true), - ]) - .unwrap() - } - #[test] fn cut_tests() { assert_cut(basic(), ii(50, 60), Ok([]), None::<[_; 0]>); @@ -2000,14 +2009,6 @@ mod tests { ]), ); } - fn special() -> RangeBoundsMap { - RangeBoundsMap::try_from([ - (mii(4, 6), false), - (mee(7, 8), true), - (mii(8, 12), false), - ]) - .unwrap() - } fn assert_cut( mut before: RangeBoundsMap, diff --git a/todo.md b/todo.md index d5f1d85..15a5dd4 100644 --- a/todo.md +++ b/todo.md @@ -9,8 +9,6 @@ - make an expand function to go RangeBounds -> (Bound, Bound) rather than doing it manually everywhere -- put basic() back in place and special() - # Documentation - replace `RangeBounds` with `K` where applicatble in docs @@ -29,11 +27,6 @@ - add coalesce if same-value otherwise overwrite) function to make finally make range_bounds_map a superset of rangemap -- make cut() return and Ok(Iterator((Bound, Bound))) like gaps() -- add gaps_same() and cut_same() which are gaps().map(to K) and - cut().map(to K) using TryFromBounds -- update the TryFromBoundsError with examples of new gaps() and cut() - # time based - use it in robot_Sweet_graph for a bit before publishing