@@ -686,9 +686,9 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
686686 NeverLoopResult :: AlwaysBreak
687687 }
688688 } ,
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+ } ) ,
692692 ExprKind :: InlineAsm ( ref asm) => asm
693693 . operands
694694 . iter ( )
@@ -1877,9 +1877,9 @@ fn is_ref_iterable_type(cx: &LateContext<'_, '_>, e: &Expr<'_>) -> bool {
18771877fn is_iterable_array < ' tcx > ( ty : Ty < ' tcx > , cx : & LateContext < ' _ , ' tcx > ) -> bool {
18781878 // IntoIterator is currently only implemented for array sizes <= 32 in rustc
18791879 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 ) ) ,
18831883 _ => false ,
18841884 }
18851885}
@@ -1891,7 +1891,7 @@ fn extract_expr_from_first_stmt<'tcx>(block: &Block<'tcx>) -> Option<&'tcx Expr<
18911891 return None ;
18921892 }
18931893 if let StmtKind :: Local ( ref local) = block. stmts [ 0 ] . kind {
1894- local. init . map ( |expr| expr)
1894+ local. init // .map(|expr| expr)
18951895 } else {
18961896 None
18971897 }
@@ -2011,11 +2011,13 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
20112011 if let PatKind :: Binding ( .., ident, _) = local. pat . kind {
20122012 self . name = Some ( ident. name ) ;
20132013
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 ) {
20152016 VarState :: Warn
20162017 } else {
20172018 VarState :: Declared
2018- } )
2019+ }
2020+ } )
20192021 }
20202022 }
20212023 }
0 commit comments