diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-31 13:16:44 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-31 13:16:44 +0100 |
commit | d7cbb49057c4495307d91f5db32465c29c175124 (patch) | |
tree | 8649259da32910831c45aee3ba9b68abce8f5b37 /crates/ide_completion/src/completions/unqualified_path.rs | |
parent | 3cb3f1d17b54a7e144db495e073551049c9c482c (diff) | |
parent | 971b0836ef425d8b962ecac70a974887a8356567 (diff) |
Merge #9077
9077: internal: Use `Name`s instead of Strings in the completion rendering api r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide_completion/src/completions/unqualified_path.rs')
-rw-r--r-- | crates/ide_completion/src/completions/unqualified_path.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs index ede07f605..9db8516d0 100644 --- a/crates/ide_completion/src/completions/unqualified_path.rs +++ b/crates/ide_completion/src/completions/unqualified_path.rs | |||
@@ -14,10 +14,10 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
14 | if ctx.expects_assoc_item() { | 14 | if ctx.expects_assoc_item() { |
15 | ctx.scope.process_all_names(&mut |name, def| { | 15 | ctx.scope.process_all_names(&mut |name, def| { |
16 | if let ScopeDef::MacroDef(macro_def) = def { | 16 | if let ScopeDef::MacroDef(macro_def) = def { |
17 | acc.add_macro(ctx, Some(name.to_string()), macro_def); | 17 | acc.add_macro(ctx, Some(name.clone()), macro_def); |
18 | } | 18 | } |
19 | if let ScopeDef::ModuleDef(hir::ModuleDef::Module(_)) = def { | 19 | if let ScopeDef::ModuleDef(hir::ModuleDef::Module(_)) = def { |
20 | acc.add_resolution(ctx, name.to_string(), &def); | 20 | acc.add_resolution(ctx, name, &def); |
21 | } | 21 | } |
22 | }); | 22 | }); |
23 | return; | 23 | return; |
@@ -27,7 +27,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
27 | cov_mark::hit!(only_completes_modules_in_import); | 27 | cov_mark::hit!(only_completes_modules_in_import); |
28 | ctx.scope.process_all_names(&mut |name, res| { | 28 | ctx.scope.process_all_names(&mut |name, res| { |
29 | if let ScopeDef::ModuleDef(hir::ModuleDef::Module(_)) = res { | 29 | if let ScopeDef::ModuleDef(hir::ModuleDef::Module(_)) = res { |
30 | acc.add_resolution(ctx, name.to_string(), &res); | 30 | acc.add_resolution(ctx, name, &res); |
31 | } | 31 | } |
32 | }); | 32 | }); |
33 | return; | 33 | return; |
@@ -45,7 +45,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC | |||
45 | cov_mark::hit!(skip_lifetime_completion); | 45 | cov_mark::hit!(skip_lifetime_completion); |
46 | return; | 46 | return; |
47 | } | 47 | } |
48 | acc.add_resolution(ctx, name.to_string(), &res); | 48 | acc.add_resolution(ctx, name, &res); |
49 | }); | 49 | }); |
50 | } | 50 | } |
51 | 51 | ||