about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src/abi.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-28 05:25:23 +0000
committerbors <bors@rust-lang.org>2025-07-28 05:25:23 +0000
commitd242a8bd5a73f633ba1ec5aacf19acf35a3c747d (patch)
tree0c2c8a3f7ebcbd838f4afef27acad292c7b0bab1 /compiler/rustc_ty_utils/src/abi.rs
parent733dab558992d902d6d17576de1da768094e2cf3 (diff)
parentb8eb046e6ee3294969bf8faf31da226b0ea29d18 (diff)
downloadrust-d242a8bd5a73f633ba1ec5aacf19acf35a3c747d.tar.gz
rust-d242a8bd5a73f633ba1ec5aacf19acf35a3c747d.zip
Auto merge of #144469 - Kivooeo:chains-cleanup, r=SparrowLii
Some `let chains` clean-up

Not sure if this kind of clean-up is welcoming because of size, but I decided to try out one

r? compiler
Diffstat (limited to 'compiler/rustc_ty_utils/src/abi.rs')
-rw-r--r--compiler/rustc_ty_utils/src/abi.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_ty_utils/src/abi.rs b/compiler/rustc_ty_utils/src/abi.rs
index f0ff50318ab..af2e000e340 100644
--- a/compiler/rustc_ty_utils/src/abi.rs
+++ b/compiler/rustc_ty_utils/src/abi.rs
@@ -642,11 +642,11 @@ fn fn_abi_adjust_for_abi<'tcx>(
                 // The `deduced_param_attrs` list could be empty if this is a type of function
                 // we can't deduce any parameters for, so make sure the argument index is in
                 // bounds.
-                if let Some(deduced_param_attrs) = deduced_param_attrs.get(arg_idx) {
-                    if deduced_param_attrs.read_only {
-                        attrs.regular.insert(ArgAttribute::ReadOnly);
-                        debug!("added deduced read-only attribute");
-                    }
+                if let Some(deduced_param_attrs) = deduced_param_attrs.get(arg_idx)
+                    && deduced_param_attrs.read_only
+                {
+                    attrs.regular.insert(ArgAttribute::ReadOnly);
+                    debug!("added deduced read-only attribute");
                 }
             }
         }