]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/large_stack_arrays.rs
Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / large_stack_arrays.rs
index 9fd3780e14e04023423491d9c94cac1994de5b3a..9a448ab125686cf2ce405a7ca9c1a84416b800c7 100644 (file)
@@ -43,8 +43,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
         if_chain! {
             if let ExprKind::Repeat(_, _) = expr.kind;
             if let ty::Array(element_type, cst) = cx.typeck_results().expr_ty(expr).kind();
-            if let ConstKind::Value(val) = cst.val;
-            if let ConstValue::Scalar(element_count) = val;
+            if let ConstKind::Value(ConstValue::Scalar(element_count)) = cst.val;
             if let Ok(element_count) = element_count.to_machine_usize(&cx.tcx);
             if let Ok(element_size) = cx.layout_of(element_type).map(|l| l.size.bytes());
             if self.maximum_allowed_size < element_count * element_size;