File tree 4 files changed +5
-7
lines changed
rustc_hir_analysis/src/check
rustc_mir_transform/src/coverage
rustc_transmute/src/layout
4 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -1317,7 +1317,7 @@ fn compare_number_of_generics<'tcx>(
1317
1317
impl_count,
1318
1318
kind,
1319
1319
pluralize!( impl_count) ,
1320
- suffix. unwrap_or_else ( String :: new ) ,
1320
+ suffix. unwrap_or_default ( ) ,
1321
1321
) ,
1322
1322
) ;
1323
1323
}
Original file line number Diff line number Diff line change @@ -292,10 +292,8 @@ impl DebugCounters {
292
292
}
293
293
294
294
pub fn some_block_label ( & self , operand : ExpressionOperandId ) -> Option < & String > {
295
- self . some_counters . as_ref ( ) . map_or ( None , |counters| {
296
- counters
297
- . get ( & operand)
298
- . map_or ( None , |debug_counter| debug_counter. some_block_label . as_ref ( ) )
295
+ self . some_counters . as_ref ( ) . and_then ( |counters| {
296
+ counters. get ( & operand) . and_then ( |debug_counter| debug_counter. some_block_label . as_ref ( ) )
299
297
} )
300
298
}
301
299
Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ pub(crate) mod rustc {
196
196
fn from ( err : LayoutError < ' tcx > ) -> Self {
197
197
match err {
198
198
LayoutError :: Unknown ( ..) => Self :: Unknown ,
199
- err @ _ => unimplemented ! ( "{:?}" , err) ,
199
+ err => unimplemented ! ( "{:?}" , err) ,
200
200
}
201
201
}
202
202
}
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ where
141
141
let f = auto_trait:: AutoTraitFinder :: new ( tcx) ;
142
142
143
143
debug ! ( "get_auto_trait_impls({:?})" , ty) ;
144
- let auto_traits: Vec < _ > = self . cx . auto_traits . iter ( ) . copied ( ) . collect ( ) ;
144
+ let auto_traits: Vec < _ > = self . cx . auto_traits . to_vec ( ) ;
145
145
let mut auto_traits: Vec < Item > = auto_traits
146
146
. into_iter ( )
147
147
. filter_map ( |trait_def_id| {
You can’t perform that action at this time.
0 commit comments