@@ -5,8 +5,8 @@ use log::{debug, trace};
5
5
use semver:: VersionReq ;
6
6
use url:: Url ;
7
7
8
- use crate :: core:: PackageSet ;
9
8
use crate :: core:: { Dependency , PackageId , Source , SourceId , SourceMap , Summary } ;
9
+ use crate :: core:: { InternedString , PackageSet } ;
10
10
use crate :: sources:: config:: SourceConfigMap ;
11
11
use crate :: util:: errors:: { CargoResult , CargoResultExt } ;
12
12
use crate :: util:: { profile, CanonicalUrl , Config } ;
@@ -94,7 +94,7 @@ type LockedMap = HashMap<
94
94
SourceId ,
95
95
HashMap <
96
96
// This next level is keyed by the name of the package...
97
- String ,
97
+ InternedString ,
98
98
// ... and the value here is a list of tuples. The first element of each
99
99
// tuple is a package which has the source/name used to get to this
100
100
// point. The second element of each tuple is the list of locked
@@ -207,9 +207,7 @@ impl<'cfg> PackageRegistry<'cfg> {
207
207
. locked
208
208
. entry ( id. source_id ( ) )
209
209
. or_insert_with ( HashMap :: new) ;
210
- let sub_vec = sub_map
211
- . entry ( id. name ( ) . to_string ( ) )
212
- . or_insert_with ( Vec :: new) ;
210
+ let sub_vec = sub_map. entry ( id. name ( ) ) . or_insert_with ( Vec :: new) ;
213
211
sub_vec. push ( ( id, deps) ) ;
214
212
}
215
213
@@ -640,7 +638,7 @@ fn lock(
640
638
) -> Summary {
641
639
let pair = locked
642
640
. get ( & summary. source_id ( ) )
643
- . and_then ( |map| map. get ( & * summary. name ( ) ) )
641
+ . and_then ( |map| map. get ( & summary. name ( ) ) )
644
642
. and_then ( |vec| vec. iter ( ) . find ( |& & ( id, _) | id == summary. package_id ( ) ) ) ;
645
643
646
644
trace ! ( "locking summary of {}" , summary. package_id( ) ) ;
@@ -730,7 +728,7 @@ fn lock(
730
728
// If anything does then we lock it to that and move on.
731
729
let v = locked
732
730
. get ( & dep. source_id ( ) )
733
- . and_then ( |map| map. get ( & * dep. package_name ( ) ) )
731
+ . and_then ( |map| map. get ( & dep. package_name ( ) ) )
734
732
. and_then ( |vec| vec. iter ( ) . find ( |& & ( id, _) | dep. matches_id ( id) ) ) ;
735
733
if let Some ( & ( id, _) ) = v {
736
734
trace ! ( "\t second hit on {}" , id) ;
0 commit comments