replaced some unwrap_or with unwrap_or_else
This commit is contained in:
parent
446d4533e8
commit
5ff1be197e
6 changed files with 11 additions and 11 deletions
|
@ -159,7 +159,7 @@ fn check_panic_str<'tcx>(
|
|||
Some(v) if v.len() == 1 => "panic message contains a brace",
|
||||
_ => "panic message contains braces",
|
||||
};
|
||||
cx.struct_span_lint(NON_FMT_PANIC, brace_spans.unwrap_or(vec![span]), |lint| {
|
||||
cx.struct_span_lint(NON_FMT_PANIC, brace_spans.unwrap_or_else(|| vec![span]), |lint| {
|
||||
let mut l = lint.build(msg);
|
||||
l.note("this message is not used as a format string, but will be in Rust 2021");
|
||||
if span.contains(arg.span) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue