diff --git a/crates/rustfix/src/lib.rs b/crates/rustfix/src/lib.rs index a1e2c47cf..0283d1a93 100644 --- a/crates/rustfix/src/lib.rs +++ b/crates/rustfix/src/lib.rs @@ -167,8 +167,6 @@ pub fn collect_suggestions( } } - let snippets = diagnostic.spans.iter().map(span_to_snippet).collect(); - let solutions: Vec<_> = diagnostic .children .iter() @@ -204,7 +202,7 @@ pub fn collect_suggestions( } else { Some(Suggestion { message: diagnostic.message.clone(), - snippets, + snippets: diagnostic.spans.iter().map(span_to_snippet).collect(), solutions, }) }