1
Fork 0

avoid collecting into vecs in some places

This commit is contained in:
Matthias Krüger 2024-03-02 14:18:47 +01:00
parent 2e3581bca9
commit 7a48987006
5 changed files with 20 additions and 33 deletions

View file

@ -1884,10 +1884,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
err.span_suggestions_with_style(
path_span.shrink_to_hi().with_hi(call_span.hi()),
"you might have meant to use an associated function to build this type",
items
.iter()
.map(|(_, name, len)| suggestion(name, *len))
.collect::<Vec<String>>(),
items.iter().map(|(_, name, len)| suggestion(name, *len)),
Applicability::MaybeIncorrect,
SuggestionStyle::ShowAlways,
);