about summary refs log tree commit diff
path: root/compiler/rustc_monomorphize/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2024-09-12 20:37:16 +1000
committerGitHub <noreply@github.com>2024-09-12 20:37:16 +1000
commit3ba12756d3bebefc18b0f623dece8898adcea6c3 (patch)
treef318a669bd833a70a12d51998d348310d02c6e1a /compiler/rustc_monomorphize/src
parentc3d1be7c7fc65081b84dd6e2713d417104fde164 (diff)
parentaf8d911d63d6b38ea2da36a330b035dd2e6f89a7 (diff)
downloadrust-3ba12756d3bebefc18b0f623dece8898adcea6c3.tar.gz
rust-3ba12756d3bebefc18b0f623dece8898adcea6c3.zip
Rollup merge of #130235 - compiler-errors:nested-if, r=michaelwoerister
Simplify some nested `if` statements

Applies some but not all instances of `clippy::collapsible_if`. Some ended up looking worse afterwards, though, so I left those out. Also applies instances of `clippy::collapsible_else_if`

Review with whitespace disabled please.
Diffstat (limited to 'compiler/rustc_monomorphize/src')
-rw-r--r--compiler/rustc_monomorphize/src/partitioning.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs
index 0d295b8f280..2d9dbdbaec2 100644
--- a/compiler/rustc_monomorphize/src/partitioning.rs
+++ b/compiler/rustc_monomorphize/src/partitioning.rs
@@ -504,10 +504,8 @@ fn compute_inlined_overlap<'tcx>(cgu1: &CodegenUnit<'tcx>, cgu2: &CodegenUnit<'t
 
     let mut overlap = 0;
     for (item, data) in src_cgu.items().iter() {
-        if data.inlined {
-            if dst_cgu.items().contains_key(item) {
-                overlap += data.size_estimate;
-            }
+        if data.inlined && dst_cgu.items().contains_key(item) {
+            overlap += data.size_estimate;
         }
     }
     overlap