mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
refactor(rustfix): only compute snippets when needed
This commit is contained in:
parent
f483dc0b95
commit
c9102e54bb
@ -167,8 +167,6 @@ pub fn collect_suggestions<S: ::std::hash::BuildHasher>(
|
||||
}
|
||||
}
|
||||
|
||||
let snippets = diagnostic.spans.iter().map(span_to_snippet).collect();
|
||||
|
||||
let solutions: Vec<_> = diagnostic
|
||||
.children
|
||||
.iter()
|
||||
@ -204,7 +202,7 @@ pub fn collect_suggestions<S: ::std::hash::BuildHasher>(
|
||||
} else {
|
||||
Some(Suggestion {
|
||||
message: diagnostic.message.clone(),
|
||||
snippets,
|
||||
snippets: diagnostic.spans.iter().map(span_to_snippet).collect(),
|
||||
solutions,
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user