@@ -686,9 +686,9 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
686
686
NeverLoopResult :: AlwaysBreak
687
687
}
688
688
} ,
689
- ExprKind :: Break ( _, ref e) | ExprKind :: Ret ( ref e) => {
690
- e . as_ref ( ) . map_or ( NeverLoopResult :: AlwaysBreak , |e| combine_seq ( never_loop_expr ( e, main_loop_id) , NeverLoopResult :: AlwaysBreak ) )
691
- } ,
689
+ ExprKind :: Break ( _, ref e) | ExprKind :: Ret ( ref e) => e . as_ref ( ) . map_or ( NeverLoopResult :: AlwaysBreak , |e| {
690
+ combine_seq ( never_loop_expr ( e, main_loop_id) , NeverLoopResult :: AlwaysBreak )
691
+ } ) ,
692
692
ExprKind :: InlineAsm ( ref asm) => asm
693
693
. operands
694
694
. iter ( )
@@ -1877,9 +1877,9 @@ fn is_ref_iterable_type(cx: &LateContext<'_, '_>, e: &Expr<'_>) -> bool {
1877
1877
fn is_iterable_array < ' tcx > ( ty : Ty < ' tcx > , cx : & LateContext < ' _ , ' tcx > ) -> bool {
1878
1878
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
1879
1879
match ty. kind {
1880
- ty:: Array ( _, n) => {
1881
- n . try_eval_usize ( cx. tcx , cx. param_env ) . map_or ( false , |val| ( 0 ..= 32 ) . contains ( & val ) )
1882
- } ,
1880
+ ty:: Array ( _, n) => n
1881
+ . try_eval_usize ( cx. tcx , cx. param_env )
1882
+ . map_or ( false , |val| ( 0 ..= 32 ) . contains ( & val ) ) ,
1883
1883
_ => false ,
1884
1884
}
1885
1885
}
@@ -1891,7 +1891,7 @@ fn extract_expr_from_first_stmt<'tcx>(block: &Block<'tcx>) -> Option<&'tcx Expr<
1891
1891
return None ;
1892
1892
}
1893
1893
if let StmtKind :: Local ( ref local) = block. stmts [ 0 ] . kind {
1894
- local. init . map ( |expr| expr)
1894
+ local. init // .map(|expr| expr)
1895
1895
} else {
1896
1896
None
1897
1897
}
@@ -2011,11 +2011,13 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
2011
2011
if let PatKind :: Binding ( .., ident, _) = local. pat . kind {
2012
2012
self . name = Some ( ident. name ) ;
2013
2013
2014
- self . state = local. init . as_ref ( ) . map_or ( VarState :: Declared , |init| if is_integer_const ( & self . cx , init, 0 ) {
2014
+ self . state = local. init . as_ref ( ) . map_or ( VarState :: Declared , |init| {
2015
+ if is_integer_const ( & self . cx , init, 0 ) {
2015
2016
VarState :: Warn
2016
2017
} else {
2017
2018
VarState :: Declared
2018
- } )
2019
+ }
2020
+ } )
2019
2021
}
2020
2022
}
2021
2023
}
0 commit comments