mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Clippy fixes
This commit is contained in:
parent
89c2aaed8c
commit
d8d35dbfcc
@ -1138,7 +1138,7 @@ pub(crate) fn handle_completion_resolve(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let Some(corresponding_completion) = completions.into_iter().find(|completion_item| {
|
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
|
hash == resolve_data.hash
|
||||||
}) else {
|
}) else {
|
||||||
return Ok(original_completion);
|
return Ok(original_completion);
|
||||||
|
@ -71,7 +71,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
|
|||||||
CompletionRelevanceTypeMatch,
|
CompletionRelevanceTypeMatch,
|
||||||
};
|
};
|
||||||
|
|
||||||
hasher.update(&[
|
hasher.update([
|
||||||
u8::from(relevance.exact_name_match),
|
u8::from(relevance.exact_name_match),
|
||||||
u8::from(relevance.is_local),
|
u8::from(relevance.is_local),
|
||||||
u8::from(relevance.is_name_already_imported),
|
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);
|
hasher.update(label);
|
||||||
}
|
}
|
||||||
if let Some(trait_) = &relevance.trait_ {
|
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 {
|
if let Some(postfix_match) = &relevance.postfix_match {
|
||||||
let label = match 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);
|
hasher.update(label);
|
||||||
}
|
}
|
||||||
if let Some(function) = &relevance.function {
|
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 {
|
let label = match function.return_type {
|
||||||
CompletionRelevanceReturnType::Other => "other",
|
CompletionRelevanceReturnType::Other => "other",
|
||||||
CompletionRelevanceReturnType::DirectConstructor => "direct_constructor",
|
CompletionRelevanceReturnType::DirectConstructor => "direct_constructor",
|
||||||
@ -108,7 +108,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut hasher = TentHasher::new();
|
let mut hasher = TentHasher::new();
|
||||||
hasher.update(&[
|
hasher.update([
|
||||||
u8::from(is_ref_completion),
|
u8::from(is_ref_completion),
|
||||||
u8::from(item.is_snippet),
|
u8::from(item.is_snippet),
|
||||||
u8::from(item.deprecated),
|
u8::from(item.deprecated),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user