aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions/lifetime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_completion/src/completions/lifetime.rs')
-rw-r--r--crates/ide_completion/src/completions/lifetime.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide_completion/src/completions/lifetime.rs b/crates/ide_completion/src/completions/lifetime.rs
index 5f6285b84..8ccccb646 100644
--- a/crates/ide_completion/src/completions/lifetime.rs
+++ b/crates/ide_completion/src/completions/lifetime.rs
@@ -16,15 +16,14 @@ pub(crate) fn complete_lifetime(acc: &mut Completions, ctx: &CompletionContext)
16 (Some(lt), Some(lp)) if lp == lt.clone() => return, 16 (Some(lt), Some(lp)) if lp == lt.clone() => return,
17 (Some(_), Some(lp)) => { 17 (Some(_), Some(lp)) => {
18 lp_string = lp.to_string(); 18 lp_string = lp.to_string();
19 Some(&lp_string) 19 Some(&*lp_string)
20 } 20 }
21 _ => None, 21 _ => None,
22 }; 22 };
23 23
24 ctx.scope.process_all_names(&mut |name, res| { 24 ctx.scope.process_all_names(&mut |name, res| {
25 if let ScopeDef::GenericParam(hir::GenericParam::LifetimeParam(_)) = res { 25 if let ScopeDef::GenericParam(hir::GenericParam::LifetimeParam(_)) = res {
26 let name = name.to_string(); 26 if param_lifetime != Some(&*name.to_string()) {
27 if param_lifetime != Some(&name) {
28 acc.add_resolution(ctx, name, &res); 27 acc.add_resolution(ctx, name, &res);
29 } 28 }
30 } 29 }
@@ -41,7 +40,7 @@ pub(crate) fn complete_label(acc: &mut Completions, ctx: &CompletionContext) {
41 } 40 }
42 ctx.scope.process_all_names(&mut |name, res| { 41 ctx.scope.process_all_names(&mut |name, res| {
43 if let ScopeDef::Label(_) = res { 42 if let ScopeDef::Label(_) = res {
44 acc.add_resolution(ctx, name.to_string(), &res); 43 acc.add_resolution(ctx, name, &res);
45 } 44 }
46 }); 45 });
47} 46}