@@ -1274,37 +1274,35 @@ impl<'a> Resolver<'a> {
1274
1274
1275
1275
pub fn into_outputs ( self ) -> ResolverOutputs {
1276
1276
let definitions = self . definitions ;
1277
- let extern_crate_map = {
1278
- let mut map = FxHashMap :: default ( ) ;
1279
- for ( k, v) in self . extern_crate_map . into_iter ( ) {
1280
- map. insert ( definitions. local_def_id ( k) . to_def_id ( ) , v) ;
1281
- }
1282
- map
1283
- } ;
1284
- let export_map = {
1285
- let mut map = FxHashMap :: default ( ) ;
1286
- for ( k, v) in self . export_map . into_iter ( ) {
1287
- map. insert (
1277
+ let extern_crate_map = self
1278
+ . extern_crate_map
1279
+ . into_iter ( )
1280
+ . map ( |( k, v) | ( definitions. local_def_id ( k) . to_def_id ( ) , v) )
1281
+ . collect ( ) ;
1282
+ let export_map = self
1283
+ . export_map
1284
+ . into_iter ( )
1285
+ . map ( |( k, v) | {
1286
+ (
1288
1287
k,
1289
1288
v. into_iter ( )
1290
1289
. map ( |e| e. map_id ( |id| definitions. node_id_to_hir_id ( id) ) )
1291
1290
. collect ( ) ,
1292
- ) ;
1293
- }
1294
- map
1295
- } ;
1296
- let trait_map = {
1297
- let mut map = FxHashMap :: default ( ) ;
1298
- for ( k, v) in self . trait_map . into_iter ( ) {
1299
- map . insert (
1291
+ )
1292
+ } )
1293
+ . collect ( ) ;
1294
+ let trait_map = self
1295
+ . trait_map
1296
+ . into_iter ( )
1297
+ . map ( | ( k, v) | {
1298
+ (
1300
1299
definitions. node_id_to_hir_id ( k) ,
1301
1300
v. into_iter ( )
1302
1301
. map ( |tc| tc. map_import_ids ( |id| definitions. node_id_to_hir_id ( id) ) )
1303
1302
. collect ( ) ,
1304
- ) ;
1305
- }
1306
- map
1307
- } ;
1303
+ )
1304
+ } )
1305
+ . collect ( ) ;
1308
1306
let maybe_unused_trait_imports = self
1309
1307
. maybe_unused_trait_imports
1310
1308
. into_iter ( )
@@ -1341,40 +1339,38 @@ impl<'a> Resolver<'a> {
1341
1339
ResolverOutputs {
1342
1340
definitions : self . definitions . clone ( ) ,
1343
1341
cstore : Box :: new ( self . cstore ( ) . clone ( ) ) ,
1344
- extern_crate_map : {
1345
- let mut map = FxHashMap :: default ( ) ;
1346
- for ( k, v) in self . extern_crate_map . iter ( ) {
1347
- map. insert ( self . definitions . local_def_id ( k. clone ( ) ) . to_def_id ( ) , v. clone ( ) ) ;
1348
- }
1349
- map
1350
- } ,
1351
- export_map : {
1352
- let mut map = FxHashMap :: default ( ) ;
1353
- for ( k, v) in self . export_map . iter ( ) {
1354
- map. insert (
1342
+ extern_crate_map : self
1343
+ . extern_crate_map
1344
+ . iter ( )
1345
+ . map ( |( k, v) | ( self . definitions . local_def_id ( k. clone ( ) ) . to_def_id ( ) , v. clone ( ) ) )
1346
+ . collect ( ) ,
1347
+ export_map : self
1348
+ . export_map
1349
+ . iter ( )
1350
+ . map ( |( k, v) | {
1351
+ (
1355
1352
k. clone ( ) ,
1356
1353
v. iter ( )
1357
1354
. map ( |e| e. clone ( ) . map_id ( |id| self . definitions . node_id_to_hir_id ( id) ) )
1358
1355
. collect ( ) ,
1359
- ) ;
1360
- }
1361
- map
1362
- } ,
1363
- trait_map : {
1364
- let mut map = FxHashMap :: default ( ) ;
1365
- for ( k, v) in self . trait_map . iter ( ) {
1366
- map . insert (
1356
+ )
1357
+ } )
1358
+ . collect ( ) ,
1359
+ trait_map : self
1360
+ . trait_map
1361
+ . iter ( )
1362
+ . map ( | ( k, v) | {
1363
+ (
1367
1364
self . definitions . node_id_to_hir_id ( k. clone ( ) ) ,
1368
1365
v. iter ( )
1369
1366
. map ( |tc| {
1370
1367
tc. clone ( )
1371
1368
. map_import_ids ( |id| self . definitions . node_id_to_hir_id ( id) )
1372
1369
} )
1373
1370
. collect ( ) ,
1374
- ) ;
1375
- }
1376
- map
1377
- } ,
1371
+ )
1372
+ } )
1373
+ . collect ( ) ,
1378
1374
glob_map : self
1379
1375
. glob_map
1380
1376
. iter ( )
0 commit comments