Fix to use for loop
This commit is contained in:
parent
44616e11d0
commit
1e59e66225
@ -519,16 +519,15 @@ impl Diagnostic {
|
|||||||
|
|
||||||
/// Helper for pushing to `self.suggestions`, if available (not disable).
|
/// Helper for pushing to `self.suggestions`, if available (not disable).
|
||||||
fn push_suggestion(&mut self, suggestion: CodeSuggestion) {
|
fn push_suggestion(&mut self, suggestion: CodeSuggestion) {
|
||||||
let in_derive = suggestion.substitutions.iter().any(|subst| {
|
for subst in &suggestion.substitutions {
|
||||||
subst.parts.iter().any(|part| {
|
for part in &subst.parts {
|
||||||
let span = part.span;
|
let span = part.span;
|
||||||
let call_site = span.ctxt().outer_expn_data().call_site;
|
let call_site = span.ctxt().outer_expn_data().call_site;
|
||||||
span.in_derive_expansion() && span.overlaps_or_adjacent(call_site)
|
if span.in_derive_expansion() && span.overlaps_or_adjacent(call_site) {
|
||||||
})
|
// Ignore if spans is from derive macro.
|
||||||
});
|
return;
|
||||||
if in_derive {
|
}
|
||||||
// Ignore if spans is from derive macro.
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(suggestions) = &mut self.suggestions {
|
if let Ok(suggestions) = &mut self.suggestions {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user