Skip to content

Commit 07244c3

Browse files
committed
refactor(spec): Make it easier to add more matches
1 parent c11deb1 commit 07244c3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cargo/core/package_id_spec.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,13 @@ impl PackageIdSpec {
180180
}
181181
}
182182

183-
match self.url {
184-
Some(ref u) => u == package_id.source_id().url(),
185-
None => true,
183+
if let Some(u) = &self.url {
184+
if u != package_id.source_id().url() {
185+
return false;
186+
}
186187
}
188+
189+
true
187190
}
188191

189192
/// Checks a list of `PackageId`s to find 1 that matches this `PackageIdSpec`. If 0, 2, or

0 commit comments

Comments
 (0)