File tree 1 file changed +19
-1
lines changed 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,24 @@ impl TryFrom<&'_ PackageId> for Crate {
114
114
}
115
115
}
116
116
}
117
+ [ "registry" , url, ..] => {
118
+ let Some ( ( _registry, krate) ) = url. split_once ( '#' ) else {
119
+ bail ! (
120
+ "malformed pkgid format: {}\n maybe the representation has changed?" ,
121
+ pkgid. repr
122
+ ) ;
123
+ } ;
124
+ let Some ( ( crate_name, crate_version) ) = krate. split_once ( '@' ) else {
125
+ bail ! (
126
+ "malformed pkgid format: {}\n maybe the representation has changed?" ,
127
+ pkgid. repr
128
+ ) ;
129
+ } ;
130
+ Ok ( Crate :: Registry ( RegistryCrate {
131
+ name : crate_name. to_string ( ) ,
132
+ version : crate_version. to_string ( ) ,
133
+ } ) )
134
+ }
117
135
_ => bail ! (
118
136
"malformed pkgid format: {}\n maybe the representation has changed?" ,
119
137
pkgid. repr
@@ -252,7 +270,7 @@ mod tests {
252
270
. to_string( ) ,
253
271
sha: None
254
272
} ) ,
255
- "registry+https://github.com/rust-lang/crates.io-index#cookie@0.15.0" => Crate :: Registry ( RegistryCrate {
273
+ "registry+https://github.com/rust-lang/crates.io-index#cookie@0.15.0" => Crate :: Registry ( RegistryCrate {
256
274
name: "cookie" . to_string( ) ,
257
275
version: "0.15.0" . to_string( ) ,
258
276
} ) ,
You can’t perform that action at this time.
0 commit comments