From 2ce2fdf53b5890d3b24990b9e7cd2924d21a1c14 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 9 Jan 2024 20:05:58 -0600 Subject: [PATCH] Add a public `Range.iter()` method (#18) --- src/range.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/range.rs b/src/range.rs index f674452d..6343677a 100644 --- a/src/range.rs +++ b/src/range.rs @@ -510,6 +510,11 @@ impl Range { _ => None, } } + + /// Iterate over the parts of the range. + pub fn iter(&self) -> impl Iterator, Bound)> { + self.segments.iter() + } } impl VersionSet for Range {