Skip to content

Commit

Permalink
Merge pull request #27 from baszalmstra/fix/version_specifiers_empty
Browse files Browse the repository at this point in the history
fix: add `VersionSpecifiers::empty()`
  • Loading branch information
konstin authored Jul 30, 2024
2 parents 9e5c466 + fb57ef0 commit 759802c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/version_specifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ impl std::ops::Deref for VersionSpecifiers {
}

impl VersionSpecifiers {
/// Matches all versions.
pub fn empty() -> Self {
Self(Vec::new())
}

/// Whether all specifiers match the given version
pub fn contains(&self, version: &Version) -> bool {
self.iter().all(|specifier| specifier.contains(version))
Expand Down

0 comments on commit 759802c

Please sign in to comment.