Skip to content

Commit

Permalink
Tweak docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Dec 12, 2023
1 parent 8fe6939 commit c260e83
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,16 @@ impl<V: Ord + Clone> Range<V> {
Self { segments: output }.check_invariants()
}

/// Returns a simpler Range that contains the same versions
/// Returns a simpler Range that contains the same versions.
///
/// For every one of the Versions provided in versions the existing range and
/// the simplified range will agree on whether it is contained.
/// For every one of the Versions provided in versions the existing range and the simplified range will agree on whether it is contained.
/// The simplified version may include or exclude versions that are not in versions as the implementation wishes.
/// For example:
/// - If all the versions are contained in the original than the range will be simplified to `full`.
/// - If none of the versions are contained in the original than the range will be simplified to `empty`.
///
/// If versions are not sorted the correctness of this function is not guaranteed.
/// If none of the versions are contained in the original than the range will be returned unmodified.
/// If the range includes a single version, it will be returned unmodified.
/// If all the versions are contained in the original than the range will be simplified to `full`.
///
/// If the given versions are not sorted the correctness of this function is not guaranteed.
pub fn simplify<'v, I>(&self, versions: I) -> Self
where
I: Iterator<Item = &'v V> + 'v,
Expand Down

0 comments on commit c260e83

Please sign in to comment.