diff --git a/src/inclusive_map.rs b/src/inclusive_map.rs index ee62bf1..a2dd692 100644 --- a/src/inclusive_map.rs +++ b/src/inclusive_map.rs @@ -527,7 +527,7 @@ where /// Gets an iterator over all the stored ranges that are /// either partially or completely overlapped by the given range. - pub fn overlapping<'a>(&'a self, range: &'a RangeInclusive) -> Overlapping { + pub fn overlapping<'a>(&'a self, range: RangeInclusive) -> Overlapping { // Find the first matching stored range by its _end_, // using sneaky layering and `Borrow` implementation. (See `range_wrappers` module.) let start_sliver = @@ -545,7 +545,7 @@ where /// Returns `true` if any range in the map completely or partially /// overlaps the given range. - pub fn overlaps(&self, range: &RangeInclusive) -> bool { + pub fn overlaps(&self, range: RangeInclusive) -> bool { self.overlapping(range).next().is_some() } } @@ -813,7 +813,7 @@ where /// [`overlapping`]: RangeInclusiveMap::overlapping #[derive(Clone, Debug)] pub struct Overlapping<'a, K, V> { - query_range: &'a RangeInclusive, + query_range: RangeInclusive, btm_range_iter: alloc::collections::btree_map::Range<'a, RangeInclusiveStartWrapper, V>, } diff --git a/src/inclusive_set.rs b/src/inclusive_set.rs index 17c89e7..b6dba1e 100644 --- a/src/inclusive_set.rs +++ b/src/inclusive_set.rs @@ -189,7 +189,7 @@ where /// either partially or completely overlapped by the given range. /// /// The iterator element type is `RangeInclusive`. - pub fn overlapping<'a>(&'a self, range: &'a RangeInclusive) -> Overlapping { + pub fn overlapping<'a>(&'a self, range: RangeInclusive) -> Overlapping { Overlapping { inner: self.rm.overlapping(range), } @@ -197,7 +197,7 @@ where /// Returns `true` if any range in the set completely or partially /// overlaps the given range. - pub fn overlaps(&self, range: &RangeInclusive) -> bool { + pub fn overlaps(&self, range: RangeInclusive) -> bool { self.overlapping(range).next().is_some() } } diff --git a/src/map.rs b/src/map.rs index 5c5d8c5..4ad6134 100644 --- a/src/map.rs +++ b/src/map.rs @@ -170,7 +170,7 @@ where /// Gets an iterator over all the stored ranges that are /// either partially or completely overlapped by the given range. - pub fn overlapping<'a>(&'a self, range: &'a Range) -> Overlapping { + pub fn overlapping<'a>(&'a self, range: Range) -> Overlapping { // Find the first matching stored range by its _end_, // using sneaky layering and `Borrow` implementation. (See `range_wrappers` module.) let start_sliver = RangeEndWrapper::new(range.start.clone()..range.start.clone()); @@ -188,7 +188,7 @@ where /// Returns `true` if any range in the map completely or partially /// overlaps the given range. - pub fn overlaps(&self, range: &Range) -> bool { + pub fn overlaps(&self, range: Range) -> bool { self.overlapping(range).next().is_some() } } @@ -701,7 +701,7 @@ where /// [`overlapping`]: RangeMap::overlapping #[derive(Clone, Debug)] pub struct Overlapping<'a, K, V> { - query_range: &'a Range, + query_range: Range, btm_range_iter: alloc::collections::btree_map::Range<'a, RangeStartWrapper, V>, } diff --git a/src/set.rs b/src/set.rs index 0233ae8..b397149 100644 --- a/src/set.rs +++ b/src/set.rs @@ -163,7 +163,7 @@ where /// either partially or completely overlapped by the given range. /// /// The iterator element type is `&Range`. - pub fn overlapping<'a>(&'a self, range: &'a Range) -> Overlapping { + pub fn overlapping<'a>(&'a self, range: Range) -> Overlapping { Overlapping { inner: self.rm.overlapping(range), } @@ -171,7 +171,7 @@ where /// Returns `true` if any range in the set completely or partially /// overlaps the given range. - pub fn overlaps(&self, range: &Range) -> bool { + pub fn overlaps(&self, range: Range) -> bool { self.overlapping(range).next().is_some() } }