Skip to content

Commit

Permalink
Add a public Range.iter() method (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb authored Jan 10, 2024
1 parent 866c0f2 commit 2ce2fdf
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 @@ -510,6 +510,11 @@ impl<V: Ord + Clone> Range<V> {
_ => None,
}
}

/// 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 2ce2fdf

Please sign in to comment.