Skip to content

Commit 10d3b3d

Browse files
arlosiweihanglo
andauthored
Add comments to clarify sparse+ urls
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
1 parent 931d8cb commit 10d3b3d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/cargo/core/source/source_id.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,13 @@ impl<'a> fmt::Display for SourceIdAsUrl<'a> {
681681
ref url,
682682
..
683683
} => {
684+
// For sparse http registry the URL already contains the prefix.
684685
if url.scheme().starts_with("sparse+") {
685-
write!(f, "{}", url)
686+
// e.g. sparse+http://example.com
687+
write!(f, "{url}")
686688
} else {
687-
write!(f, "registry+{}", url)
689+
// e.g. registry+http://example.com
690+
write!(f, "registry+{url}")
688691
}
689692
}
690693
SourceIdInner {

0 commit comments

Comments
 (0)