refactor(spec): Make it easier to add more matches

This commit is contained in:
Ed Page 2023-11-07 15:14:35 -06:00
parent 91d6ecc634
commit 55fb612e45
1 changed files with 6 additions and 3 deletions

View File

@ -180,10 +180,13 @@ impl PackageIdSpec {
}
}
match self.url {
Some(ref u) => u == package_id.source_id().url(),
None => true,
if let Some(u) = &self.url {
if u != package_id.source_id().url() {
return false;
}
}
true
}
/// Checks a list of `PackageId`s to find 1 that matches this `PackageIdSpec`. If 0, 2, or