1- use std:: collections:: { HashMap , HashSet , BTreeSet } ;
1+ use std:: collections:: { HashMap , BTreeMap , HashSet , BTreeSet } ;
22use std:: fmt;
33use std:: fs;
44use std:: path:: { Path , PathBuf } ;
@@ -207,21 +207,21 @@ pub struct TomlManifest {
207207 example : Option < Vec < TomlExampleTarget > > ,
208208 test : Option < Vec < TomlTestTarget > > ,
209209 bench : Option < Vec < TomlTestTarget > > ,
210- dependencies : Option < HashMap < String , TomlDependency > > ,
210+ dependencies : Option < BTreeMap < String , TomlDependency > > ,
211211 #[ serde( rename = "dev-dependencies" ) ]
212- dev_dependencies : Option < HashMap < String , TomlDependency > > ,
212+ dev_dependencies : Option < BTreeMap < String , TomlDependency > > ,
213213 #[ serde( rename = "dev_dependencies" ) ]
214- dev_dependencies2 : Option < HashMap < String , TomlDependency > > ,
214+ dev_dependencies2 : Option < BTreeMap < String , TomlDependency > > ,
215215 #[ serde( rename = "build-dependencies" ) ]
216- build_dependencies : Option < HashMap < String , TomlDependency > > ,
216+ build_dependencies : Option < BTreeMap < String , TomlDependency > > ,
217217 #[ serde( rename = "build_dependencies" ) ]
218- build_dependencies2 : Option < HashMap < String , TomlDependency > > ,
219- features : Option < HashMap < String , Vec < String > > > ,
220- target : Option < HashMap < String , TomlPlatform > > ,
221- replace : Option < HashMap < String , TomlDependency > > ,
222- patch : Option < HashMap < String , HashMap < String , TomlDependency > > > ,
218+ build_dependencies2 : Option < BTreeMap < String , TomlDependency > > ,
219+ features : Option < BTreeMap < String , Vec < String > > > ,
220+ target : Option < BTreeMap < String , TomlPlatform > > ,
221+ replace : Option < BTreeMap < String , TomlDependency > > ,
222+ patch : Option < BTreeMap < String , BTreeMap < String , TomlDependency > > > ,
223223 workspace : Option < TomlWorkspace > ,
224- badges : Option < HashMap < String , HashMap < String , String > > > ,
224+ badges : Option < BTreeMap < String , BTreeMap < String , String > > > ,
225225 #[ serde( rename = "cargo-features" ) ]
226226 cargo_features : Option < Vec < String > > ,
227227}
@@ -475,8 +475,8 @@ impl TomlManifest {
475475 cargo_features : self . cargo_features . clone ( ) ,
476476 } ;
477477
478- fn map_deps ( deps : Option < & HashMap < String , TomlDependency > > )
479- -> Option < HashMap < String , TomlDependency > >
478+ fn map_deps ( deps : Option < & BTreeMap < String , TomlDependency > > )
479+ -> Option < BTreeMap < String , TomlDependency > >
480480 {
481481 let deps = match deps {
482482 Some ( deps) => deps,
@@ -557,7 +557,7 @@ impl TomlManifest {
557557
558558 fn process_dependencies (
559559 cx : & mut Context ,
560- new_deps : Option < & HashMap < String , TomlDependency > > ,
560+ new_deps : Option < & BTreeMap < String , TomlDependency > > ,
561561 kind : Option < Kind > )
562562 -> CargoResult < ( ) >
563563 {
@@ -600,7 +600,7 @@ impl TomlManifest {
600600 }
601601
602602 {
603- let mut names_sources = HashMap :: new ( ) ;
603+ let mut names_sources = BTreeMap :: new ( ) ;
604604 for dep in & deps {
605605 let name = dep. name ( ) ;
606606 let prev = names_sources. insert ( name, dep. source_id ( ) ) ;
@@ -616,7 +616,7 @@ impl TomlManifest {
616616 let include = project. include . clone ( ) . unwrap_or_default ( ) ;
617617
618618 let summary = Summary :: new ( pkgid, deps, me. features . clone ( )
619- . unwrap_or_else ( HashMap :: new) ) ?;
619+ . unwrap_or_else ( BTreeMap :: new) ) ?;
620620 let metadata = ManifestMetadata {
621621 description : project. description . clone ( ) ,
622622 homepage : project. homepage . clone ( ) ,
@@ -985,15 +985,15 @@ impl ser::Serialize for PathValue {
985985/// Corresponds to a `target` entry, but `TomlTarget` is already used.
986986#[ derive( Serialize , Deserialize , Debug ) ]
987987struct TomlPlatform {
988- dependencies : Option < HashMap < String , TomlDependency > > ,
988+ dependencies : Option < BTreeMap < String , TomlDependency > > ,
989989 #[ serde( rename = "build-dependencies" ) ]
990- build_dependencies : Option < HashMap < String , TomlDependency > > ,
990+ build_dependencies : Option < BTreeMap < String , TomlDependency > > ,
991991 #[ serde( rename = "build_dependencies" ) ]
992- build_dependencies2 : Option < HashMap < String , TomlDependency > > ,
992+ build_dependencies2 : Option < BTreeMap < String , TomlDependency > > ,
993993 #[ serde( rename = "dev-dependencies" ) ]
994- dev_dependencies : Option < HashMap < String , TomlDependency > > ,
994+ dev_dependencies : Option < BTreeMap < String , TomlDependency > > ,
995995 #[ serde( rename = "dev_dependencies" ) ]
996- dev_dependencies2 : Option < HashMap < String , TomlDependency > > ,
996+ dev_dependencies2 : Option < BTreeMap < String , TomlDependency > > ,
997997}
998998
999999impl TomlTarget {
0 commit comments