@@ -4,9 +4,6 @@ use std::ops::{Range, RangeInclusive};
4
4
pub trait RangeExt < T > {
5
5
fn overlaps ( & self , other : & Self ) -> bool ;
6
6
fn touches ( & self , other : & Self ) -> bool ;
7
- // TODO: Remove once https://github.com/rust-lang/rust/issues/32311
8
- // is stabilized.
9
- fn contains_item ( & self , item : & T ) -> bool ;
10
7
}
11
8
12
9
impl < T > RangeExt < T > for Range < T >
@@ -26,22 +23,13 @@ where
26
23
// or immediately adjacent.
27
24
max ( & self . start , & other. start ) <= min ( & self . end , & other. end )
28
25
}
29
-
30
- // TODO: Remove once https://github.com/rust-lang/rust/issues/32311
31
- // is stabilized.
32
- fn contains_item ( & self , item : & T ) -> bool {
33
- * item >= self . start && * item < self . end
34
- }
35
26
}
36
27
37
28
pub trait RangeInclusiveExt < T > {
38
29
fn overlaps ( & self , other : & Self ) -> bool ;
39
30
fn touches ( & self , other : & Self ) -> bool
40
31
where
41
32
T : StepLite + Bounded + Clone ;
42
- // TODO: Remove once https://github.com/rust-lang/rust/issues/32311
43
- // is stabilized.
44
- fn contains_item ( & self , item : & T ) -> bool ;
45
33
}
46
34
47
35
impl < T > RangeInclusiveExt < T > for RangeInclusive < T >
76
64
} ;
77
65
max ( self . start ( ) , other. start ( ) ) <= min ( & longer_self_end, & longer_other_end)
78
66
}
79
-
80
- // TODO: Remove once https://github.com/rust-lang/rust/issues/32311
81
- // is stabilized.
82
- fn contains_item ( & self , item : & T ) -> bool {
83
- * item >= * self . start ( ) && * item <= * self . end ( )
84
- }
85
67
}
86
68
87
69
/// Minimal version of unstable [Step](std::iter::Step) trait
0 commit comments