diff --git a/src/range.rs b/src/range.rs index df39bea6..bbca4da2 100644 --- a/src/range.rs +++ b/src/range.rs @@ -508,6 +508,11 @@ impl Range { } Self { segments }.check_invariants() } + + /// Iterate over the parts of the range. + pub fn iter(&self) -> impl Iterator, &Bound)> { + self.segments.iter().map(|(start, end)| (start, end)) + } } impl VersionSet for Range {