l.span_suggestion_verbose(
arg_span.shrink_to_lo(),
"add a \"{}\" format string to Display the message",
- "\"{}\", ".into(),
+ "\"{}\", ",
fmt_applicability,
);
} else if suggest_debug {
"add a \"{{:?}}\" format string to use the Debug implementation of `{}`",
ty,
),
- "\"{:?}\", ".into(),
+ "\"{:?}\", ",
fmt_applicability,
);
}
if n_arguments > 0 && fmt_parser.errors.is_empty() {
let arg_spans: Vec<_> = match &fmt_parser.arg_places[..] {
[] => vec![fmt_span],
- v => v.iter().map(|span| fmt_span.from_inner(*span)).collect(),
+ v => v
+ .iter()
+ .map(|span| fmt_span.from_inner(InnerSpan::new(span.start, span.end)))
+ .collect(),
};
cx.struct_span_lint(NON_FMT_PANICS, arg_spans, |lint| {
let mut l = lint.build(match n_arguments {
l.span_suggestion(
arg.span.shrink_to_hi(),
&format!("add the missing argument{}", pluralize!(n_arguments)),
- ", ...".into(),
+ ", ...",
Applicability::HasPlaceholders,
);
l.span_suggestion(
arg.span.shrink_to_lo(),
"or add a \"{}\" format string to use the message literally",
- "\"{}\", ".into(),
+ "\"{}\", ",
Applicability::MachineApplicable,
);
}
l.span_suggestion(
arg.span.shrink_to_lo(),
"add a \"{}\" format string to use the message literally",
- "\"{}\", ".into(),
+ "\"{}\", ",
Applicability::MachineApplicable,
);
}