Clippy fixes

This commit is contained in:
Kirill Bulatov 2024-12-10 01:04:02 +02:00
parent 89c2aaed8c
commit d8d35dbfcc
2 changed files with 5 additions and 5 deletions

View file

@ -1138,7 +1138,7 @@ pub(crate) fn handle_completion_resolve(
};
let Some(corresponding_completion) = completions.into_iter().find(|completion_item| {
let hash = completion_item_hash(&completion_item, resolve_data.for_ref);
let hash = completion_item_hash(completion_item, resolve_data.for_ref);
hash == resolve_data.hash
}) else {
return Ok(original_completion);

View file

@ -71,7 +71,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
CompletionRelevanceTypeMatch,
};
hasher.update(&[
hasher.update([
u8::from(relevance.exact_name_match),
u8::from(relevance.is_local),
u8::from(relevance.is_name_already_imported),
@ -86,7 +86,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
hasher.update(label);
}
if let Some(trait_) = &relevance.trait_ {
hasher.update(&[u8::from(trait_.is_op_method), u8::from(trait_.notable_trait)]);
hasher.update([u8::from(trait_.is_op_method), u8::from(trait_.notable_trait)]);
}
if let Some(postfix_match) = &relevance.postfix_match {
let label = match postfix_match {
@ -96,7 +96,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
hasher.update(label);
}
if let Some(function) = &relevance.function {
hasher.update(&[u8::from(function.has_params), u8::from(function.has_self_param)]);
hasher.update([u8::from(function.has_params), u8::from(function.has_self_param)]);
let label = match function.return_type {
CompletionRelevanceReturnType::Other => "other",
CompletionRelevanceReturnType::DirectConstructor => "direct_constructor",
@ -108,7 +108,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
}
let mut hasher = TentHasher::new();
hasher.update(&[
hasher.update([
u8::from(is_ref_completion),
u8::from(item.is_snippet),
u8::from(item.deprecated),