diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2023-01-16 21:27:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-16 15:27:41 -0500 |
commit | e023a6e3f05c0ad3c06a8ad3ed6684c6b1dbd82b (patch) | |
tree | bdc461fb3727d24ad6d4071d1329649cd7dcc1c3 /cli/lsp/analysis.rs | |
parent | 40527526e569532fa076e05a229f29c6edd4522c (diff) |
refactor(cli): fewer clones (#17450)
Diffstat (limited to 'cli/lsp/analysis.rs')
-rw-r--r-- | cli/lsp/analysis.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index ddad05ee3..c7f5ba8aa 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -29,12 +29,7 @@ use tower_lsp::lsp_types::Range; /// Diagnostic error codes which actually are the same, and so when grouping /// fixes we treat them the same. static FIX_ALL_ERROR_CODES: Lazy<HashMap<&'static str, &'static str>> = - Lazy::new(|| { - ([("2339", "2339"), ("2345", "2339")]) - .iter() - .cloned() - .collect() - }); + Lazy::new(|| ([("2339", "2339"), ("2345", "2339")]).into_iter().collect()); /// Fixes which help determine if there is a preferred fix when there are /// multiple fixes available. @@ -54,8 +49,7 @@ static PREFERRED_FIXES: Lazy<HashMap<&'static str, (u32, bool)>> = ("addMissingAwait", (1, false)), ("fixImport", (0, true)), ]) - .iter() - .cloned() + .into_iter() .collect() }); |