File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
crates/cargo-util-schemas/src Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,13 @@ impl TomlLockfileSourceId {
109109 EncodableSourceIdError ( EncodableSourceIdErrorKind :: InvalidSource ( source. clone ( ) ) . into ( ) )
110110 } ) ?;
111111
112- let url = Url :: parse ( url) . map_err ( |msg| EncodableSourceIdErrorKind :: InvalidUrl {
113- url : url. to_string ( ) ,
114- msg : msg. to_string ( ) ,
112+ // Sparse URLs store the kind prefix (sparse+) in the URL. Therefore, for sparse kinds, we
113+ // want to use the raw `source` instead of the splitted `url`.
114+ let url = Url :: parse ( if kind == "sparse" { & source } else { url } ) . map_err ( |msg| {
115+ EncodableSourceIdErrorKind :: InvalidUrl {
116+ url : url. to_string ( ) ,
117+ msg : msg. to_string ( ) ,
118+ }
115119 } ) ?;
116120
117121 let kind = match kind {
You can’t perform that action at this time.
0 commit comments