aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/render.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/render.rs')
-rw-r--r--crates/ide_completion/src/render.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs
index 12921e12b..2b6e9ebd1 100644
--- a/crates/ide_completion/src/render.rs
+++ b/crates/ide_completion/src/render.rs
@@ -243,7 +243,7 @@ impl<'a> Render<'a> {
243 243
244 item.set_relevance(CompletionRelevance { 244 item.set_relevance(CompletionRelevance {
245 exact_type_match: compute_exact_type_match(self.ctx.completion, &ty), 245 exact_type_match: compute_exact_type_match(self.ctx.completion, &ty),
246 exact_name_match: compute_exact_name_match(self.ctx.completion, local_name.clone()), 246 exact_name_match: compute_exact_name_match(self.ctx.completion, &local_name),
247 is_local: true, 247 is_local: true,
248 ..CompletionRelevance::default() 248 ..CompletionRelevance::default()
249 }); 249 });
@@ -319,8 +319,7 @@ fn compute_exact_type_match(ctx: &CompletionContext, completion_ty: &hir::Type)
319 319
320fn compute_exact_name_match(ctx: &CompletionContext, completion_name: impl Into<String>) -> bool { 320fn compute_exact_name_match(ctx: &CompletionContext, completion_name: impl Into<String>) -> bool {
321 let completion_name = completion_name.into(); 321 let completion_name = completion_name.into();
322 322 ctx.expected_name.as_ref().map_or(false, |name| name.text() == completion_name)
323 Some(&completion_name) == ctx.expected_name.as_ref()
324} 323}
325 324
326fn compute_ref_match(ctx: &CompletionContext, completion_ty: &hir::Type) -> Option<Mutability> { 325fn compute_ref_match(ctx: &CompletionContext, completion_ty: &hir::Type) -> Option<Mutability> {