We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79866e1 commit 88ff1c9Copy full SHA for 88ff1c9
src/cargo/core/source_id.rs
@@ -666,15 +666,12 @@ impl fmt::Display for SourceId {
666
}
667
668
/// The hash of SourceId is used in the name of some Cargo folders, so shouldn't
669
-/// vary. `as_str` gives the serialisation of a url (which has a spec) and so
+/// vary. [`CanonicalUrl`] uses `as_str`, the serialisation of a url (which has a spec), and so
670
/// insulates against possible changes in how the url crate does hashing.
671
impl Hash for SourceId {
672
fn hash<S: hash::Hasher>(&self, into: &mut S) {
673
self.inner.kind.hash(into);
674
- match self.inner.kind {
675
- SourceKind::Git(_) => self.inner.canonical_url.hash(into),
676
- _ => self.inner.url.as_str().hash(into),
677
- }
+ self.inner.canonical_url.hash(into);
678
679
680
0 commit comments