]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/default_numeric_fallback.rs
Rollup merge of #85760 - ChrisDenton:path-doc-platform-specific, r=m-ou-se
[rust.git] / src / tools / clippy / clippy_lints / src / default_numeric_fallback.rs
index 73f71d88b05254a5d9ed0e6a4b6f88e767974b8f..759f7d4062d448ba64e3218b6435c65841fb864a 100644 (file)
@@ -131,8 +131,8 @@ fn visit_expr(&mut self, expr: &'tcx Expr<'_>) {
             },
 
             ExprKind::Struct(_, fields, base) => {
+                let ty = self.cx.typeck_results().expr_ty(expr);
                 if_chain! {
-                    let ty = self.cx.typeck_results().expr_ty(expr);
                     if let Some(adt_def) = ty.ty_adt_def();
                     if adt_def.is_struct();
                     if let Some(variant) = adt_def.variants.iter().next();
@@ -181,9 +181,9 @@ fn visit_stmt(&mut self, stmt: &'tcx Stmt<'_>) {
         match stmt.kind {
             StmtKind::Local(local) => {
                 if local.ty.is_some() {
-                    self.ty_bounds.push(TyBound::Any)
+                    self.ty_bounds.push(TyBound::Any);
                 } else {
-                    self.ty_bounds.push(TyBound::Nothing)
+                    self.ty_bounds.push(TyBound::Nothing);
                 }
             },