remove useless conversions
This commit is contained in:
@@ -101,8 +101,7 @@ impl DiagnosticCollection {
|
||||
file_id: FileId,
|
||||
) -> impl Iterator<Item = &lsp_types::Diagnostic> {
|
||||
let native = self.native.get(&file_id).into_iter().flatten();
|
||||
let check =
|
||||
self.check.values().filter_map(move |it| it.get(&file_id)).into_iter().flatten();
|
||||
let check = self.check.values().filter_map(move |it| it.get(&file_id)).flatten();
|
||||
native.chain(check)
|
||||
}
|
||||
|
||||
|
||||
@@ -1101,9 +1101,7 @@ pub(crate) fn handle_code_action(
|
||||
}
|
||||
|
||||
// Fixes from `cargo check`.
|
||||
for fix in
|
||||
snap.check_fixes.values().filter_map(|it| it.get(&frange.file_id)).into_iter().flatten()
|
||||
{
|
||||
for fix in snap.check_fixes.values().filter_map(|it| it.get(&frange.file_id)).flatten() {
|
||||
// FIXME: this mapping is awkward and shouldn't exist. Refactor
|
||||
// `snap.check_fixes` to not convert to LSP prematurely.
|
||||
let intersect_fix_range = fix
|
||||
|
||||
Reference in New Issue
Block a user