From 7aa5ea9a4a10a657dbfa58c12a11aa2cd0b5bc32 Mon Sep 17 00:00:00 2001 From: Caio Date: Tue, 1 Mar 2022 07:43:12 -0300 Subject: 7 - Make more use of `let_chains` Continuation of #94376. cc #53667 --- compiler/rustc_mir_transform/src/coverage/debug.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'compiler/rustc_mir_transform/src/coverage/debug.rs') diff --git a/compiler/rustc_mir_transform/src/coverage/debug.rs b/compiler/rustc_mir_transform/src/coverage/debug.rs index 62e060c8e0c..8e28ed2426b 100644 --- a/compiler/rustc_mir_transform/src/coverage/debug.rs +++ b/compiler/rustc_mir_transform/src/coverage/debug.rs @@ -357,14 +357,12 @@ impl DebugCounters { if let Some(counters) = &self.some_counters { if let Some(DebugCounter { counter_kind, some_block_label }) = counters.get(&operand) { if let CoverageKind::Expression { .. } = counter_kind { - if let Some(block_label) = some_block_label { - if debug_options().counter_format.block { - return format!( - "{}:({})", - block_label, - self.format_counter_kind(counter_kind) - ); - } + if let Some(label) = some_block_label && debug_options().counter_format.block { + return format!( + "{}:({})", + label, + self.format_counter_kind(counter_kind) + ); } return format!("({})", self.format_counter_kind(counter_kind)); } -- cgit 1.4.1-3-g733a5