Skip to content

Commit

Permalink
Add comments to clarify sparse+ urls
Browse files Browse the repository at this point in the history
Co-authored-by: Weihang Lo <[email protected]>
  • Loading branch information
arlosi and weihanglo authored Oct 7, 2022
1 parent 931d8cb commit 10d3b3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cargo/core/source/source_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,13 @@ impl<'a> fmt::Display for SourceIdAsUrl<'a> {
ref url,
..
} => {
// For sparse http registry the URL already contains the prefix.
if url.scheme().starts_with("sparse+") {
write!(f, "{}", url)
// e.g. sparse+http://example.com
write!(f, "{url}")
} else {
write!(f, "registry+{}", url)
// e.g. registry+http://example.com
write!(f, "registry+{url}")
}
}
SourceIdInner {
Expand Down

0 comments on commit 10d3b3d

Please sign in to comment.