Create a new set from a sequence of intervals. Each interval is specified as a pair of bounds, where both bounds are inclusive. The given ranges do not need to be in any specific order, and ranges may overlap.
(intervals: T)
| 41 | /// The given ranges do not need to be in any specific order, and ranges |
| 42 | /// may overlap. |
| 43 | pub fn new<T: IntoIterator<Item=I>>(intervals: T) -> IntervalSet<I> { |
| 44 | let mut set = IntervalSet { ranges: intervals.into_iter().collect() }; |
| 45 | set.canonicalize(); |
| 46 | set |
| 47 | } |
| 48 | |
| 49 | /// Add a new interval to this set. |
| 50 | pub fn push(&mut self, interval: I) { |
nothing calls this directly
no test coverage detected