diff --git a/src/range.rs b/src/range.rs index 98285683..2f4347a1 100644 --- a/src/range.rs +++ b/src/range.rs @@ -238,9 +238,9 @@ impl Range { /// The `versions` iterator must be sorted. /// Functionally equivalent to `versions.map(|v| self.contains(v))`. /// Except it runs in `O(size_of_range + len_of_versions)` not `O(size_of_range * len_of_versions)` - pub fn contains_many<'s, I, BV>(&'s self, versions: I) -> impl Iterator + 's + pub fn contains_many<'s, I, BV>(&'s self, versions: I) -> impl Iterator + 's where - I: Iterator + 's, + I: Iterator + 's, BV: Borrow + 's, { #[cfg(debug_assertions)] @@ -310,7 +310,7 @@ impl Range { /// Implementing `PartialOrd` for start `Bound` of an interval. /// -/// Legend: `∞` is unbounded, `[1,2]` is `>1,<2`, `]1,2[` is `>=1,<=2`. +/// Legend: `∞` is unbounded, `[1,2]` is `>=1,<=2`, `]1,2[` is `>1,<2`. /// /// ```text /// left: ∞-------] @@ -347,7 +347,7 @@ fn cmp_bounds_start(left: Bound<&V>, right: Bound<&V>) -> Option< /// /// We flip the unbounded ranges from `-∞` to `∞`, while `V`-valued bounds checks remain the same. /// -/// Legend: `∞` is unbounded, `[1,2]` is `>1,<2`, `]1,2[` is `>=1,<=2`. +/// Legend: `∞` is unbounded, `[1,2]` is `>=1,<=2`, `]1,2[` is `>1,<2`. /// /// ```text /// left: [--------∞ @@ -503,8 +503,8 @@ fn left_end_is_smaller(left: Bound, right: Bound) -> bool { /// [None, 1, 4, 7, None, None, None, 8, None, 9] -> [(1, 7), (8, 8), (9, None)] /// ``` fn group_adjacent_locations( - mut locations: impl Iterator>, -) -> impl Iterator, Option)> { + mut locations: impl Iterator>, +) -> impl Iterator, Option)> { // If the first version matched, then the lower bound of that segment is not needed let mut seg = locations.next().flatten().map(|ver| (None, Some(ver))); std::iter::from_fn(move || { @@ -720,7 +720,7 @@ impl Range { /// If the given versions are not sorted the correctness of this function is not guaranteed. pub fn simplify<'s, I, BV>(&self, versions: I) -> Self where - I: Iterator + 's, + I: Iterator + 's, BV: Borrow + 's, { // Do not simplify singletons @@ -770,7 +770,7 @@ impl Range { /// start of the first and the end of the second. fn keep_segments( &self, - kept_segments: impl Iterator, Option)>, + kept_segments: impl Iterator, Option)>, ) -> Range { let mut segments = SmallVec::Empty; for (s, e) in kept_segments { @@ -783,7 +783,7 @@ impl Range { } /// Iterate over the parts of the range. - pub fn iter(&self) -> impl Iterator, &Bound)> { + pub fn iter(&self) -> impl Iterator, &Bound)> { self.segments.iter().map(|(start, end)| (start, end)) } } @@ -903,7 +903,7 @@ pub mod tests { /// Generate version sets from a random vector of deltas between bounds. /// Each bound is randomly inclusive or exclusive. - pub fn strategy() -> impl Strategy> { + pub fn strategy() -> impl Strategy> { ( any::(), prop::collection::vec(any::<(u32, bool)>(), 1..10), @@ -965,7 +965,7 @@ pub mod tests { }) } - fn version_strat() -> impl Strategy { + fn version_strat() -> impl Strategy { any::() }