Skip to content

Commit c9102e5

Browse files
committed
refactor(rustfix): only compute snippets when needed
1 parent f483dc0 commit c9102e5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crates/rustfix/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ pub fn collect_suggestions<S: ::std::hash::BuildHasher>(
167167
}
168168
}
169169

170-
let snippets = diagnostic.spans.iter().map(span_to_snippet).collect();
171-
172170
let solutions: Vec<_> = diagnostic
173171
.children
174172
.iter()
@@ -204,7 +202,7 @@ pub fn collect_suggestions<S: ::std::hash::BuildHasher>(
204202
} else {
205203
Some(Suggestion {
206204
message: diagnostic.message.clone(),
207-
snippets,
205+
snippets: diagnostic.spans.iter().map(span_to_snippet).collect(),
208206
solutions,
209207
})
210208
}

0 commit comments

Comments
 (0)