Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Aug 20, 2024
1 parent d1ab0f7 commit ba01791
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ impl<V: Ord> Range<V> {
/// 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<Item = bool> + 's
pub fn contains_many<'s, I, BV>(&'s self, versions: I) -> impl Iterator<Item=bool> + 's
where
I: Iterator<Item = BV> + 's,
I: Iterator<Item=BV> + 's,
BV: Borrow<V> + 's,
{
#[cfg(debug_assertions)]
Expand Down Expand Up @@ -310,7 +310,7 @@ impl<V: Ord> Range<V> {

/// 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: ∞-------]
Expand Down Expand Up @@ -347,7 +347,7 @@ fn cmp_bounds_start<V: PartialOrd>(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: [--------∞
Expand Down Expand Up @@ -503,8 +503,8 @@ fn left_end_is_smaller<V: PartialOrd>(left: Bound<V>, right: Bound<V>) -> 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<Item = Option<usize>>,
) -> impl Iterator<Item = (Option<usize>, Option<usize>)> {
mut locations: impl Iterator<Item=Option<usize>>,
) -> impl Iterator<Item=(Option<usize>, Option<usize>)> {
// 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 || {
Expand Down Expand Up @@ -720,7 +720,7 @@ impl<V: Ord + Clone> Range<V> {
/// 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<Item = BV> + 's,
I: Iterator<Item=BV> + 's,
BV: Borrow<V> + 's,
{
// Do not simplify singletons
Expand Down Expand Up @@ -770,7 +770,7 @@ impl<V: Ord + Clone> Range<V> {
/// start of the first and the end of the second.
fn keep_segments(
&self,
kept_segments: impl Iterator<Item = (Option<usize>, Option<usize>)>,
kept_segments: impl Iterator<Item=(Option<usize>, Option<usize>)>,
) -> Range<V> {
let mut segments = SmallVec::Empty;
for (s, e) in kept_segments {
Expand All @@ -783,7 +783,7 @@ impl<V: Ord + Clone> Range<V> {
}

/// Iterate over the parts of the range.
pub fn iter(&self) -> impl Iterator<Item = (&Bound<V>, &Bound<V>)> {
pub fn iter(&self) -> impl Iterator<Item=(&Bound<V>, &Bound<V>)> {
self.segments.iter().map(|(start, end)| (start, end))
}
}
Expand Down Expand Up @@ -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<Value = Range<u32>> {
pub fn strategy() -> impl Strategy<Value=Range<u32>> {
(
any::<bool>(),
prop::collection::vec(any::<(u32, bool)>(), 1..10),
Expand Down Expand Up @@ -965,7 +965,7 @@ pub mod tests {
})
}

fn version_strat() -> impl Strategy<Value = u32> {
fn version_strat() -> impl Strategy<Value=u32> {
any::<u32>()
}

Expand Down

0 comments on commit ba01791

Please sign in to comment.