Skip to content

Commit

Permalink
feat: add a public Range.iter() method (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb authored and konstin committed Mar 11, 2024
1 parent a23e746 commit cbe0f18
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ impl<V: Ord + Clone> Range<V> {
}
Self { segments }.check_invariants()
}

/// Iterate over the parts of the range.
pub fn iter(&self) -> impl Iterator<Item = &(Bound<V>, Bound<V>)> {
self.segments.iter()
}
}

impl<T: Debug + Display + Clone + Eq + Ord> VersionSet for Range<T> {
Expand Down

0 comments on commit cbe0f18

Please sign in to comment.