about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/nonstandard_style.rs
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-26 06:21:54 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-28 06:10:14 +0500
commitbae38bad7803be7fdf1878188da9650f82548016 (patch)
tree6ac78d3032bec33e133feaf8f9aa4e8027cb362d /compiler/rustc_lint/src/nonstandard_style.rs
parent43725ed819c57b86b32a66c40572246b1f5b8952 (diff)
downloadrust-bae38bad7803be7fdf1878188da9650f82548016.tar.gz
rust-bae38bad7803be7fdf1878188da9650f82548016.zip
use let chains in hir, lint, mir
Diffstat (limited to 'compiler/rustc_lint/src/nonstandard_style.rs')
-rw-r--r--compiler/rustc_lint/src/nonstandard_style.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs
index db89396d1dc..76e374deef6 100644
--- a/compiler/rustc_lint/src/nonstandard_style.rs
+++ b/compiler/rustc_lint/src/nonstandard_style.rs
@@ -623,15 +623,15 @@ impl<'tcx> LateLintPass<'tcx> for NonUpperCaseGlobals {
             ..
         }) = p.kind
         {
-            if let Res::Def(DefKind::Const, _) = path.res {
-                if let [segment] = path.segments {
-                    NonUpperCaseGlobals::check_upper_case(
-                        cx,
-                        "constant in pattern",
-                        None,
-                        &segment.ident,
-                    );
-                }
+            if let Res::Def(DefKind::Const, _) = path.res
+                && let [segment] = path.segments
+            {
+                NonUpperCaseGlobals::check_upper_case(
+                    cx,
+                    "constant in pattern",
+                    None,
+                    &segment.ident,
+                );
             }
         }
     }