Refactor internal suggestion API

This commit is contained in:
Oliver Schneider 2017-11-03 16:17:33 +01:00
parent 525b81d570
commit 443332afaf
No known key found for this signature in database
GPG key ID: A69F8D225B3AD7D9
5 changed files with 111 additions and 122 deletions

View file

@ -278,17 +278,17 @@ impl DiagnosticSpan {
fn from_suggestion(suggestion: &CodeSuggestion, je: &JsonEmitter)
-> Vec<DiagnosticSpan> {
suggestion.substitution_parts
suggestion.substitutions
.iter()
.flat_map(|substitution| {
substitution.substitutions.iter().map(move |suggestion| {
substitution.parts.iter().map(move |suggestion| {
let span_label = SpanLabel {
span: substitution.span,
span: suggestion.span,
is_primary: true,
label: None,
};
DiagnosticSpan::from_span_label(span_label,
Some(suggestion),
Some(&suggestion.snippet),
je)
})
})