@@ -357,7 +357,7 @@ struct Context {
357
357
warnings : RcList < String > ,
358
358
}
359
359
360
- type Activations = HashMap < InternedString , HashMap < SourceId , Rc < Vec < Summary > > > > ;
360
+ type Activations = HashMap < ( InternedString , SourceId ) , Rc < Vec < Summary > > > ;
361
361
362
362
/// Builds the list of all packages required to build the first argument.
363
363
pub fn resolve ( summaries : & [ ( Summary , Method ) ] ,
@@ -389,7 +389,6 @@ pub fn resolve(summaries: &[(Summary, Method)],
389
389
} ;
390
390
391
391
for summary in cx. activations . values ( )
392
- . flat_map ( |v| v. values ( ) )
393
392
. flat_map ( |v| v. iter ( ) ) {
394
393
let cksum = summary. checksum ( ) . map ( |s| s. to_string ( ) ) ;
395
394
resolve. checksums . insert ( summary. package_id ( ) . clone ( ) , cksum) ;
@@ -1305,9 +1304,7 @@ impl Context {
1305
1304
method : & Method ) -> CargoResult < bool > {
1306
1305
let id = summary. package_id ( ) ;
1307
1306
let prev = self . activations
1308
- . entry ( InternedString :: new ( id. name ( ) ) )
1309
- . or_insert_with ( HashMap :: new)
1310
- . entry ( id. source_id ( ) . clone ( ) )
1307
+ . entry ( ( InternedString :: new ( id. name ( ) ) , id. source_id ( ) . clone ( ) ) )
1311
1308
. or_insert_with ( ||Rc :: new ( Vec :: new ( ) ) ) ;
1312
1309
if !prev. iter ( ) . any ( |c| c == summary) {
1313
1310
self . resolve_graph . push ( GraphNode :: Add ( id. clone ( ) ) ) ;
@@ -1368,15 +1365,13 @@ impl Context {
1368
1365
}
1369
1366
1370
1367
fn prev_active ( & self , dep : & Dependency ) -> & [ Summary ] {
1371
- self . activations . get ( & InternedString :: new ( dep. name ( ) ) )
1372
- . and_then ( |v| v. get ( dep. source_id ( ) ) )
1368
+ self . activations . get ( & ( InternedString :: new ( dep. name ( ) ) , dep. source_id ( ) . clone ( ) ) )
1373
1369
. map ( |v| & v[ ..] )
1374
1370
. unwrap_or ( & [ ] )
1375
1371
}
1376
1372
1377
1373
fn is_active ( & self , id : & PackageId ) -> bool {
1378
- self . activations . get ( & InternedString :: new ( id. name ( ) ) )
1379
- . and_then ( |v| v. get ( id. source_id ( ) ) )
1374
+ self . activations . get ( & ( InternedString :: new ( id. name ( ) ) , id. source_id ( ) . clone ( ) ) )
1380
1375
. map ( |v| v. iter ( ) . any ( |s| s. package_id ( ) == id) )
1381
1376
. unwrap_or ( false )
1382
1377
}
@@ -1484,7 +1479,6 @@ impl Context {
1484
1479
fn check_cycles ( resolve : & Resolve , activations : & Activations )
1485
1480
-> CargoResult < ( ) > {
1486
1481
let summaries: HashMap < & PackageId , & Summary > = activations. values ( )
1487
- . flat_map ( |v| v. values ( ) )
1488
1482
. flat_map ( |v| v. iter ( ) )
1489
1483
. map ( |s| ( s. package_id ( ) , s) )
1490
1484
. collect ( ) ;
0 commit comments