Pass suggestions as impl Iterator instead of Vec
This commit is contained in:
parent
0db7abe5b6
commit
9ff0f33748
6 changed files with 10 additions and 10 deletions
|
@ -350,10 +350,10 @@ impl Diagnostic {
|
|||
}
|
||||
|
||||
pub fn span_suggestions_with_applicability(&mut self, sp: Span, msg: &str,
|
||||
suggestions: Vec<String>,
|
||||
applicability: Applicability) -> &mut Self {
|
||||
suggestions: impl Iterator<Item = String>, applicability: Applicability) -> &mut Self
|
||||
{
|
||||
self.suggestions.push(CodeSuggestion {
|
||||
substitutions: suggestions.into_iter().map(|snippet| Substitution {
|
||||
substitutions: suggestions.map(|snippet| Substitution {
|
||||
parts: vec![SubstitutionPart {
|
||||
snippet,
|
||||
span: sp,
|
||||
|
|
|
@ -253,7 +253,7 @@ impl<'a> DiagnosticBuilder<'a> {
|
|||
pub fn span_suggestions_with_applicability(&mut self,
|
||||
sp: Span,
|
||||
msg: &str,
|
||||
suggestions: Vec<String>,
|
||||
suggestions: impl Iterator<Item = String>,
|
||||
applicability: Applicability)
|
||||
-> &mut Self {
|
||||
if !self.allow_suggestions {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue