Skip to content

Commit 61c0b26

Browse files
Clippy fixes
1 parent b203c73 commit 61c0b26

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ pub(crate) fn handle_completion_resolve(
11381138
};
11391139

11401140
let Some(corresponding_completion) = completions.into_iter().find(|completion_item| {
1141-
let hash = completion_item_hash(&completion_item, resolve_data.for_ref);
1141+
let hash = completion_item_hash(completion_item, resolve_data.for_ref);
11421142
hash == resolve_data.hash
11431143
}) else {
11441144
return Ok(original_completion);

src/tools/rust-analyzer/crates/rust-analyzer/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
7171
CompletionRelevanceTypeMatch,
7272
};
7373

74-
hasher.update(&[
74+
hasher.update([
7575
u8::from(relevance.exact_name_match),
7676
u8::from(relevance.is_local),
7777
u8::from(relevance.is_name_already_imported),
@@ -86,7 +86,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
8686
hasher.update(label);
8787
}
8888
if let Some(trait_) = &relevance.trait_ {
89-
hasher.update(&[u8::from(trait_.is_op_method), u8::from(trait_.notable_trait)]);
89+
hasher.update([u8::from(trait_.is_op_method), u8::from(trait_.notable_trait)]);
9090
}
9191
if let Some(postfix_match) = &relevance.postfix_match {
9292
let label = match postfix_match {
@@ -96,7 +96,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
9696
hasher.update(label);
9797
}
9898
if let Some(function) = &relevance.function {
99-
hasher.update(&[u8::from(function.has_params), u8::from(function.has_self_param)]);
99+
hasher.update([u8::from(function.has_params), u8::from(function.has_self_param)]);
100100
let label = match function.return_type {
101101
CompletionRelevanceReturnType::Other => "other",
102102
CompletionRelevanceReturnType::DirectConstructor => "direct_constructor",
@@ -108,7 +108,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
108108
}
109109

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

0 commit comments

Comments
 (0)