(b: impl RangeBounds<u64>)
| 85 | |
| 86 | impl RangeFromMaybeToInclusive { |
| 87 | pub fn from_range_bounds(b: impl RangeBounds<u64>) -> Self { |
| 88 | let start = match b.start_bound() { |
| 89 | Bound::Unbounded => 0, |
| 90 | Bound::Included(start) => *start, |
| 91 | Bound::Excluded(start) => start + 1, |
| 92 | }; |
| 93 | let end = match b.end_bound() { |
| 94 | Bound::Unbounded => None, |
| 95 | Bound::Included(end) => Some(*end), |
| 96 | Bound::Excluded(end) => Some(end.saturating_sub(1)), |
| 97 | }; |
| 98 | |
| 99 | Self { start, end } |
| 100 | } |
| 101 | |
| 102 | pub fn is_empty(&self) -> bool { |
| 103 | self.end.is_some_and(|end| end < self.start) |
nothing calls this directly
no test coverage detected