about summary refs log tree commit diff
path: root/clippy_lints/src/default_numeric_fallback.rs
diff options
context:
space:
mode:
authorCameron Steffen <cam.steffen94@gmail.com>2021-03-30 14:59:59 -0500
committerCameron Steffen <cam.steffen94@gmail.com>2021-03-31 14:06:27 -0500
commit827d6aaad4a7ec24dd3191160cefe0c1e0b654b9 (patch)
tree4134e62173b1d077f44e784f4f1091368d3106a5 /clippy_lints/src/default_numeric_fallback.rs
parent5f887d09b87d7c6a9c3a4f6afa62a20847dd2509 (diff)
downloadrust-827d6aaad4a7ec24dd3191160cefe0c1e0b654b9.tar.gz
rust-827d6aaad4a7ec24dd3191160cefe0c1e0b654b9.zip
Eat dogfood
Diffstat (limited to 'clippy_lints/src/default_numeric_fallback.rs')
-rw-r--r--clippy_lints/src/default_numeric_fallback.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/default_numeric_fallback.rs b/clippy_lints/src/default_numeric_fallback.rs
index d136db9373c..42bafc3442e 100644
--- a/clippy_lints/src/default_numeric_fallback.rs
+++ b/clippy_lints/src/default_numeric_fallback.rs
@@ -130,8 +130,8 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
             },
 
             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();