Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Aug 20, 2024
1 parent 8198c86 commit 01c648d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 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 @@ -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 01c648d

Please sign in to comment.