fix failing tests
This commit is contained in:
14 files changed
+51
-149
No files matched your search
@@ -36,9 +36,7 @@ pub struct RangeSet<T: Ord> {
|
||||
pub store: RBTree<NaiveRangeAdapter<T>>,
|
||||
}
|
||||
|
||||
fn normalize_range<R: RangeBounds<T>, T: Copy + Ord + Add<Output = T> + From<u8>>(
|
||||
r: &R,
|
||||
) -> NaiveRange<T> {
|
||||
fn normalize_range<R: RangeBounds<T>, T: Copy + Ord + Add<Output = T> + From<u8>>(r: &R) -> NaiveRange<T> {
|
||||
let start = match r.start_bound() {
|
||||
Bound::Included(x) => *x,
|
||||
Bound::Excluded(x) => *x + T::from(1),
|
||||
@@ -114,11 +112,7 @@ mod tests {
|
||||
set.add(&(2000..2001));
|
||||
set.add(&(-10..-2));
|
||||
set.add(&(-1..-1));
|
||||
let end = set
|
||||
.store
|
||||
.iter()
|
||||
.map(|r| (r.start, r.end))
|
||||
.collect::<Vec<_>>();
|
||||
let end = set.store.iter().map(|r| (r.start, r.end)).collect::<Vec<_>>();
|
||||
assert_eq!(end, [(-10, 10), (50, 2001)])
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user