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 and konstin committed Mar 6, 2024
1 parent ec30428 commit 23f48ba
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 @@ -542,6 +542,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 23f48ba

Please sign in to comment.