Remove unnecessary .collect()
This commit is contained in:
parent
987155f35d
commit
1dfec45dc9
1 changed files with 7 additions and 7 deletions
|
@ -777,15 +777,15 @@ impl Diagnostic {
|
||||||
applicability: Applicability,
|
applicability: Applicability,
|
||||||
style: SuggestionStyle,
|
style: SuggestionStyle,
|
||||||
) -> &mut Self {
|
) -> &mut Self {
|
||||||
let suggestions: Vec<_> = suggestions.into_iter().collect();
|
|
||||||
debug_assert!(
|
|
||||||
!(sp.is_empty() && suggestions.iter().any(|suggestion| suggestion.is_empty())),
|
|
||||||
"Span must not be empty and have no suggestion"
|
|
||||||
);
|
|
||||||
|
|
||||||
let substitutions = suggestions
|
let substitutions = suggestions
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|snippet| Substitution { parts: vec![SubstitutionPart { snippet, span: sp }] })
|
.map(|snippet| {
|
||||||
|
debug_assert!(
|
||||||
|
!(sp.is_empty() && snippet.is_empty()),
|
||||||
|
"Span must not be empty and have no suggestion"
|
||||||
|
);
|
||||||
|
Substitution { parts: vec![SubstitutionPart { snippet, span: sp }] }
|
||||||
|
})
|
||||||
.collect();
|
.collect();
|
||||||
self.push_suggestion(CodeSuggestion {
|
self.push_suggestion(CodeSuggestion {
|
||||||
substitutions,
|
substitutions,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue