@@ -319,13 +319,13 @@ struct IndexPackageV {
319
319
pub struct RegistryDependency < ' a > {
320
320
/// Name of the dependency. If the dependency is renamed, the original
321
321
/// would be stored in [`RegistryDependency::package`].
322
- pub name : InternedString ,
322
+ pub name : Cow < ' a , str > ,
323
323
/// The SemVer requirement for this dependency.
324
324
#[ serde( borrow) ]
325
325
pub req : Cow < ' a , str > ,
326
326
/// Set of features enabled for this dependency.
327
327
#[ serde( default ) ]
328
- pub features : Vec < InternedString > ,
328
+ pub features : Vec < Cow < ' a , str > > ,
329
329
/// Whether or not this is an optional dependency.
330
330
#[ serde( default ) ]
331
331
pub optional : bool ,
@@ -844,9 +844,13 @@ impl<'a> RegistryDependency<'a> {
844
844
default
845
845
} ;
846
846
847
- let mut dep = Dependency :: parse ( package. unwrap_or ( name) , Some ( & req) , id) ?;
847
+ let mut dep = Dependency :: parse (
848
+ package. unwrap_or ( InternedString :: new ( & name) ) ,
849
+ Some ( & req) ,
850
+ id,
851
+ ) ?;
848
852
if package. is_some ( ) {
849
- dep. set_explicit_name_in_toml ( name) ;
853
+ dep. set_explicit_name_in_toml ( InternedString :: new ( & name) ) ;
850
854
}
851
855
let kind = match kind. as_deref ( ) . unwrap_or ( "" ) {
852
856
"dev" => DepKind :: Development ,
@@ -880,6 +884,10 @@ impl<'a> RegistryDependency<'a> {
880
884
dep. set_artifact ( artifact) ;
881
885
}
882
886
887
+ let features = features
888
+ . iter ( )
889
+ . map ( |f| InternedString :: new ( & f) )
890
+ . collect :: < Vec < _ > > ( ) ;
883
891
dep. set_optional ( optional)
884
892
. set_default_features ( default_features)
885
893
. set_features ( features)
0 commit comments