about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2022-08-30 17:18:01 +0200
committerMara Bos <m-ou.se@m-ou.se>2022-09-27 13:31:51 +0200
commitdf7fd119d2ad54667cfe46a60db6f7fb799d4e90 (patch)
tree19dd5fdf84317627355aa4ac1a37a8a5935782d3
parente65c96e4adcae72d694bf083ed191c409126e5ce (diff)
downloadrust-df7fd119d2ad54667cfe46a60db6f7fb799d4e90.tar.gz
rust-df7fd119d2ad54667cfe46a60db6f7fb799d4e90.zip
Use if let chain.
-rw-r--r--compiler/rustc_builtin_macros/src/format.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_builtin_macros/src/format.rs b/compiler/rustc_builtin_macros/src/format.rs
index 7228b270698..fe963a0ea3a 100644
--- a/compiler/rustc_builtin_macros/src/format.rs
+++ b/compiler/rustc_builtin_macros/src/format.rs
@@ -236,10 +236,8 @@ pub fn make_format_args(
         if let Some(note) = err.note {
             e.note(&note);
         }
-        if let Some((label, span)) = err.secondary_label {
-            if is_literal {
-                e.span_label(fmt_span.from_inner(InnerSpan::new(span.start, span.end)), label);
-            }
+        if let Some((label, span)) = err.secondary_label && is_literal {
+            e.span_label(fmt_span.from_inner(InnerSpan::new(span.start, span.end)), label);
         }
         if err.should_be_replaced_with_positional_argument {
             let captured_arg_span =