Skip to content

Commit df7fd11

Browse files
committed
Use if let chain.
1 parent e65c96e commit df7fd11

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/rustc_builtin_macros/src/format.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,8 @@ pub fn make_format_args(
236236
if let Some(note) = err.note {
237237
e.note(&note);
238238
}
239-
if let Some((label, span)) = err.secondary_label {
240-
if is_literal {
241-
e.span_label(fmt_span.from_inner(InnerSpan::new(span.start, span.end)), label);
242-
}
239+
if let Some((label, span)) = err.secondary_label && is_literal {
240+
e.span_label(fmt_span.from_inner(InnerSpan::new(span.start, span.end)), label);
243241
}
244242
if err.should_be_replaced_with_positional_argument {
245243
let captured_arg_span =

0 commit comments

Comments
 (0)