mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
remove useless conversions
This commit is contained in:
parent
cc80c5bd07
commit
efd2c20e96
17 changed files with 26 additions and 38 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue