From d41c089522b7942e6bf3822c929018f7ddc22904 Mon Sep 17 00:00:00 2001 From: Marek Kaput Date: Tue, 3 Dec 2024 13:59:17 +0100 Subject: [PATCH 1/2] Remove dependency on `rustc-hash` There is no hard data on any perf benefits of using it at the single place we do, and fewer dependencies is always a good improvement. --- Cargo.lock | 1 - Cargo.toml | 1 - src/server/client.rs | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f16f9a5..b88a4117 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -746,7 +746,6 @@ dependencies = [ "pathdiff", "pretty_assertions", "rust-analyzer-salsa", - "rustc-hash", "scarb-metadata", "scarb-proc-macro-server-types", "scarb-stable-hash", diff --git a/Cargo.toml b/Cargo.toml index 83ab4769..70b219c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,6 @@ itertools = "0.12.1" jod-thread = "0.1.2" lsp-server = "0.7.7" lsp-types = "=0.95.0" -rustc-hash = "1.1.0" salsa = { package = "rust-analyzer-salsa", version = "0.17.0-pre.6" } scarb-metadata = "1.13" scarb-proc-macro-server-types = "0.1" diff --git a/src/server/client.rs b/src/server/client.rs index db799ddb..153b410b 100644 --- a/src/server/client.rs +++ b/src/server/client.rs @@ -6,11 +6,11 @@ // +-----------------------------------------------------+ use std::any::TypeId; +use std::collections::HashMap; use anyhow::Result; use lsp_server::{Notification, RequestId, Response}; use lsp_types::notification::Notification as NotificationTrait; -use rustc_hash::FxHashMap; use serde_json::Value; use tracing::error; @@ -35,7 +35,7 @@ pub struct Responder(ClientSender); pub struct Requester<'s> { sender: ClientSender, next_request_id: i32, - response_handlers: FxHashMap>, + response_handlers: HashMap>, } impl Client<'_> { @@ -46,7 +46,7 @@ impl Client<'_> { requester: Requester { sender, next_request_id: 1, - response_handlers: FxHashMap::default(), + response_handlers: HashMap::default(), }, } } From c1911bfde43c6128d7d3a038ae783d349de5dbb6 Mon Sep 17 00:00:00 2001 From: Marek Kaput Date: Tue, 3 Dec 2024 14:34:41 +0100 Subject: [PATCH 2/2] default --- src/server/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/client.rs b/src/server/client.rs index 153b410b..9cd0f57b 100644 --- a/src/server/client.rs +++ b/src/server/client.rs @@ -46,7 +46,7 @@ impl Client<'_> { requester: Requester { sender, next_request_id: 1, - response_handlers: HashMap::default(), + response_handlers: Default::default(), }, } }