Skip to content

Commit

Permalink
feat: add iterators to match upsteam
Browse files Browse the repository at this point in the history
  • Loading branch information
Eh2406 committed May 9, 2024
1 parent a9240d0 commit eb78a8c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ impl SemverPubgrub {
.simplify(versions.filter(|v| !v.borrow().pre.is_empty())),
}
}

/// Iterate over the parts of the range that can match normal releases.
pub fn iter_normal(&self) -> impl Iterator<Item = (&Bound<Version>, &Bound<Version>)> {
self.normal.iter()
}

/// Iterate over the parts of the range that can match pre-releases.
pub fn iter_pre(&self) -> impl Iterator<Item = (&Bound<Version>, &Bound<Version>)> {
self.pre.iter()
}
}

impl Display for SemverPubgrub {
Expand Down

0 comments on commit eb78a8c

Please sign in to comment.