Skip to content

Commit d6943d9

Browse files
committed
Update TentHash to version 1.0
The TentHash spec was frozen Jan 1st 2025, and release 1.0 of the Rust crate is a minor cleanup as a follow-up to that, representing a commitment to API stability as well. The hash output remains the same as version 0.4, which rust-analyzer was previously using. The only API change was a struct rename.
1 parent bc10a44 commit d6943d9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rust-analyzer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ rustc-hash.workspace = true
3737
serde_json = { workspace = true, features = ["preserve_order"] }
3838
serde.workspace = true
3939
serde_derive.workspace = true
40-
tenthash = "0.4.0"
40+
tenthash = "1.0.0"
4141
num_cpus = "1.15.0"
4242
mimalloc = { version = "0.1.30", default-features = false, optional = true }
4343
lsp-server.workspace = true

crates/rust-analyzer/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ mod integrated_benchmarks;
5050
use hir::Mutability;
5151
use ide::{CompletionItem, CompletionItemRefMode, CompletionRelevance};
5252
use serde::de::DeserializeOwned;
53-
use tenthash::TentHasher;
53+
use tenthash::TentHash;
5454

5555
pub use crate::{
5656
lsp::capabilities::server_capabilities, main_loop::main_loop, reload::ws_to_crate_graph,
@@ -66,7 +66,7 @@ pub fn from_json<T: DeserializeOwned>(
6666
}
6767

6868
fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8; 20] {
69-
fn hash_completion_relevance(hasher: &mut TentHasher, relevance: &CompletionRelevance) {
69+
fn hash_completion_relevance(hasher: &mut TentHash, relevance: &CompletionRelevance) {
7070
use ide_completion::{
7171
CompletionRelevancePostfixMatch, CompletionRelevanceReturnType,
7272
CompletionRelevanceTypeMatch,
@@ -108,7 +108,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
108108
}
109109
}
110110

111-
let mut hasher = TentHasher::new();
111+
let mut hasher = TentHash::new();
112112
hasher.update([
113113
u8::from(is_ref_completion),
114114
u8::from(item.is_snippet),

0 commit comments

Comments
 (0)