Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #19067 from cessen/update_tenthash
Update TentHash to version 1.0
Laurențiu Nicola 2025-01-29
parent bc10a44 · parent d6943d9 · commit 13cde50
-rw-r--r--Cargo.lock4
-rw-r--r--crates/rust-analyzer/Cargo.toml2
-rw-r--r--crates/rust-analyzer/src/lib.rs6
3 files changed, 6 insertions, 6 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 2dfca7c480..3ba7df3ad5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2001,9 +2001,9 @@ dependencies = [
[[package]]
name = "tenthash"
-version = "0.4.0"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d67f9f3cf70e0852941d7bc3cb884b49b24b8ee956baf91ad0abae31f5ef11fb"
+checksum = "2d092d622df8bb64e5de8dc86a3667702d5f1e0fe2f0604c6035540703c8cd1e"
[[package]]
name = "test-fixture"
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index c24cbb4a31..b8ce2b7430 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -37,7 +37,7 @@ rustc-hash.workspace = true
serde_json = { workspace = true, features = ["preserve_order"] }
serde.workspace = true
serde_derive.workspace = true
-tenthash = "0.4.0"
+tenthash = "1.0.0"
num_cpus = "1.15.0"
mimalloc = { version = "0.1.30", default-features = false, optional = true }
lsp-server.workspace = true
diff --git a/crates/rust-analyzer/src/lib.rs b/crates/rust-analyzer/src/lib.rs
index ccffa7a671..02361a2232 100644
--- a/crates/rust-analyzer/src/lib.rs
+++ b/crates/rust-analyzer/src/lib.rs
@@ -50,7 +50,7 @@ mod integrated_benchmarks;
use hir::Mutability;
use ide::{CompletionItem, CompletionItemRefMode, CompletionRelevance};
use serde::de::DeserializeOwned;
-use tenthash::TentHasher;
+use tenthash::TentHash;
pub use crate::{
lsp::capabilities::server_capabilities, main_loop::main_loop, reload::ws_to_crate_graph,
@@ -66,7 +66,7 @@ pub fn from_json<T: DeserializeOwned>(
}
fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8; 20] {
- fn hash_completion_relevance(hasher: &mut TentHasher, relevance: &CompletionRelevance) {
+ fn hash_completion_relevance(hasher: &mut TentHash, relevance: &CompletionRelevance) {
use ide_completion::{
CompletionRelevancePostfixMatch, CompletionRelevanceReturnType,
CompletionRelevanceTypeMatch,
@@ -108,7 +108,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
}
}
- let mut hasher = TentHasher::new();
+ let mut hasher = TentHash::new();
hasher.update([
u8::from(is_ref_completion),
u8::from(item.is_snippet),