remove useless conversions

This commit is contained in:
Daniel Eades 2022-12-30 08:42:44 +00:00
parent cc80c5bd07
commit efd2c20e96
17 changed files with 26 additions and 38 deletions

View file

@ -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)
}

View file

@ -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