Skip to content

Commit

Permalink
Merge pull request #19067 from cessen/update_tenthash
Browse files Browse the repository at this point in the history
Update TentHash to version 1.0
  • Loading branch information
lnicola authored Jan 29, 2025
2 parents bc10a44 + d6943d9 commit 13cde50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions crates/rust-analyzer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 13cde50

Please sign in to comment.