Skip to content

Commit

Permalink
Add iter_mut to Ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Nov 4, 2024
1 parent 95e1390 commit 5aadec2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions version-ranges/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,11 @@ impl<V: Ord + Clone> Ranges<V> {
pub fn iter(&self) -> impl Iterator<Item = (&Bound<V>, &Bound<V>)> {
self.segments.iter().map(|(start, end)| (start, end))
}

/// Iterate over the parts of the range.
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&mut Bound<V>, &mut Bound<V>)> {
self.segments.iter_mut().map(|(start, end)| (start, end))
}
}

// REPORT ######################################################################
Expand Down

0 comments on commit 5aadec2

Please sign in to comment.