Skip to content

Commit

Permalink
consistency between Range::iter and Range::bounding_range
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Aug 16, 2024
1 parent 2fac393 commit b3a273d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,10 @@ impl<V: Ord + Clone> Range<V> {
}

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

Expand Down

0 comments on commit b3a273d

Please sign in to comment.