diff options
| author | Satya Rohith <me@satyarohith.com> | 2024-06-14 17:10:57 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-14 17:10:57 +0530 |
| commit | 0f48313565ed2620efbd9d0f2203b57f8f126e6a (patch) | |
| tree | 39e348917188b7524eadc138dfcf80f92a185ac6 /cli/lsp | |
| parent | e19ee6eecc416a99801231ac53f2c512ba1f81dd (diff) | |
chore: upgrade to rust 1.79 (#24207)
Diffstat (limited to 'cli/lsp')
| -rw-r--r-- | cli/lsp/config.rs | 2 | ||||
| -rw-r--r-- | cli/lsp/path_to_regex.rs | 11 | ||||
| -rw-r--r-- | cli/lsp/resolver.rs | 2 | ||||
| -rw-r--r-- | cli/lsp/testing/execution.rs | 2 | ||||
| -rw-r--r-- | cli/lsp/tsc.rs | 11 |
5 files changed, 11 insertions, 17 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index ae9ec6db8..327f725e4 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -1780,7 +1780,7 @@ impl ConfigTree { ); } } - self.first_folder = settings.first_folder.clone(); + self.first_folder.clone_from(&settings.first_folder); self.scopes = Arc::new(scopes); } diff --git a/cli/lsp/path_to_regex.rs b/cli/lsp/path_to_regex.rs index 10cd651d8..88d8a2ec6 100644 --- a/cli/lsp/path_to_regex.rs +++ b/cli/lsp/path_to_regex.rs @@ -795,8 +795,6 @@ impl Compiler { #[derive(Debug)] pub struct MatchResult { - pub path: String, - pub index: usize, pub params: HashMap<StringOrNumber, StringOrVec>, } @@ -824,9 +822,6 @@ impl Matcher { /// Match a string path, optionally returning the match result. pub fn matches(&self, path: &str) -> Option<MatchResult> { let caps = self.re.captures(path).ok()??; - let m = caps.get(0)?; - let path = m.as_str().to_string(); - let index = m.start(); let mut params = HashMap::new(); if let Some(keys) = &self.maybe_keys { for (i, key) in keys.iter().enumerate() { @@ -852,11 +847,7 @@ impl Matcher { } } - Some(MatchResult { - path, - index, - params, - }) + Some(MatchResult { params }) } } diff --git a/cli/lsp/resolver.rs b/cli/lsp/resolver.rs index c06bbfc8d..9790dfed7 100644 --- a/cli/lsp/resolver.rs +++ b/cli/lsp/resolver.rs @@ -502,7 +502,7 @@ impl RedirectResolver { } }; for (specifier, mut entry) in chain { - entry.destination = destination.clone(); + entry.destination.clone_from(&destination); self.entries.insert(specifier, Some(Arc::new(entry))); } destination diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs index 6393c8642..b73bcd130 100644 --- a/cli/lsp/testing/execution.rs +++ b/cli/lsp/testing/execution.rs @@ -350,7 +350,7 @@ impl TestRun { test::TestEvent::Wait(id) => { reporter.report_wait(tests.read().get(&id).unwrap()); } - test::TestEvent::Output(_, output) => { + test::TestEvent::Output(output) => { reporter.report_output(&output); } test::TestEvent::Slow(id, elapsed) => { diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 76a33a532..5e5a509ac 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -385,7 +385,10 @@ impl TsServer { } None => None, }; - *self.inspector_server.lock() = maybe_inspector_server.clone(); + self + .inspector_server + .lock() + .clone_from(&maybe_inspector_server); // TODO(bartlomieju): why is the join_handle ignored here? Should we store it // on the `TsServer` struct. let receiver = self.receiver.lock().take().unwrap(); @@ -1718,7 +1721,7 @@ fn display_parts_to_string( "linkName" => { if let Some(link) = current_link.as_mut() { link.name = Some(part.text.clone()); - link.target = part.target.clone(); + link.target.clone_from(&part.target); } } "linkText" => { @@ -2271,7 +2274,7 @@ impl RenameLocations { let asset_or_doc = language_server.get_asset_or_document(&specifier)?; // ensure TextDocumentEdit for `location.file_name`. - if text_document_edit_map.get(&uri).is_none() { + if !text_document_edit_map.contains_key(&uri) { text_document_edit_map.insert( uri.clone(), lsp::TextDocumentEdit { @@ -3633,7 +3636,7 @@ impl CompletionEntry { .check_specifier(&import_specifier, specifier) .or_else(|| relative_specifier(specifier, &import_specifier)) { - display_source = new_module_specifier.clone(); + display_source.clone_from(&new_module_specifier); if new_module_specifier != import_data.module_specifier { specifier_rewrite = Some((import_data.module_specifier, new_module_specifier)); |
