44fn inclusive_start_end<T: Idx>(
45 range: impl RangeBounds<T>,
46▶ domain: usize,
47) -> Option<(usize, usize)> {
48 // Both start and end are inclusive.
· · ·
55 Bound::Included(end) => end.index(),
56 Bound::Excluded(end) => end.index().checked_sub(1)?,
57▶ Bound::Unbounded => domain - 1,
58 };
59 assert!(end < domain);
· · ·
59▶ assert!(end < domain);
60 if start > end {
61 return None;
· · ·
97/// A fixed-size bitset type with a dense representation.
98///
99▶/// Note 1: Since this bitset is dense, if your domain is big, and/or relatively
100/// homogeneous (for example, with long runs of bits set or unset), then it may
101/// be preferable to instead use a [MixedBitSet], or an
· · ·
102/// [IntervalSet](crate::interval::IntervalSet). They should be more suited to
103▶/// sparse, or highly-compressible, domains.
104///
105/// Note 2: Use [`GrowableBitSet`] if you need support for resizing after creation.
+ 155 more matches in this file