summaryrefslogtreecommitdiff
path: root/cli/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp')
-rw-r--r--cli/lsp/analysis.rs10
-rw-r--r--cli/lsp/diagnostics.rs8
-rw-r--r--cli/lsp/documents.rs12
3 files changed, 9 insertions, 21 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()
});
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs
index 605bd85ac..b4be63a55 100644
--- a/cli/lsp/diagnostics.rs
+++ b/cli/lsp/diagnostics.rs
@@ -525,12 +525,10 @@ async fn generate_ts_diagnostics(
let specifiers = snapshot
.documents
.documents(true, true)
- .iter()
- .map(|d| d.specifier().clone())
- .collect::<Vec<_>>();
+ .into_iter()
+ .map(|d| d.specifier().clone());
let (enabled_specifiers, disabled_specifiers) = specifiers
- .iter()
- .cloned()
+ .into_iter()
.partition::<Vec<_>, _>(|s| config.specifier_enabled(s));
let ts_diagnostics_map: TsDiagnosticsMap = if !enabled_specifiers.is_empty() {
let req = tsc::RequestMethod::GetDiagnostics(enabled_specifiers);
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs
index 92dfdf543..0e3cb2a7f 100644
--- a/cli/lsp/documents.rs
+++ b/cli/lsp/documents.rs
@@ -52,15 +52,13 @@ static JS_HEADERS: Lazy<HashMap<String, String>> = Lazy::new(|| {
"content-type".to_string(),
"application/javascript".to_string(),
)])
- .iter()
- .cloned()
+ .into_iter()
.collect()
});
static JSX_HEADERS: Lazy<HashMap<String, String>> = Lazy::new(|| {
([("content-type".to_string(), "text/jsx".to_string())])
- .iter()
- .cloned()
+ .into_iter()
.collect()
});
@@ -69,15 +67,13 @@ static TS_HEADERS: Lazy<HashMap<String, String>> = Lazy::new(|| {
"content-type".to_string(),
"application/typescript".to_string(),
)])
- .iter()
- .cloned()
+ .into_iter()
.collect()
});
static TSX_HEADERS: Lazy<HashMap<String, String>> = Lazy::new(|| {
([("content-type".to_string(), "text/tsx".to_string())])
- .iter()
- .cloned()
+ .into_iter()
.collect()
});