diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-12 17:29:20 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-12 17:29:20 +0000 |
commit | 10f633283180d513138d0d969eceba96e3ce9f96 (patch) | |
tree | e53212d4569e73c7337bb205e937174f425fda5b /crates/completion/src | |
parent | 479d1f7eec22c3564867223e2093f14774092528 (diff) | |
parent | 26a1675764c9f96cc96d75d2129dd6c828b8df51 (diff) |
Merge #6846
6846: Remove some redundant allocations r=kjeremy a=kjeremy
Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates/completion/src')
-rw-r--r-- | crates/completion/src/completions/unqualified_path.rs | 2 | ||||
-rw-r--r-- | crates/completion/src/render/function.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 2b0924ae5..b9315f6c0 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs | |||
@@ -147,7 +147,7 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<() | |||
147 | .filter_map(|(import_path, definition)| { | 147 | .filter_map(|(import_path, definition)| { |
148 | render_resolution_with_import( | 148 | render_resolution_with_import( |
149 | RenderContext::new(ctx), | 149 | RenderContext::new(ctx), |
150 | ImportEdit { import_path: import_path.clone(), import_scope: import_scope.clone() }, | 150 | ImportEdit { import_path, import_scope: import_scope.clone() }, |
151 | &definition, | 151 | &definition, |
152 | ) | 152 | ) |
153 | }); | 153 | }); |
diff --git a/crates/completion/src/render/function.rs b/crates/completion/src/render/function.rs index d16005249..316e05b52 100644 --- a/crates/completion/src/render/function.rs +++ b/crates/completion/src/render/function.rs | |||
@@ -91,7 +91,7 @@ impl<'a> FunctionRender<'a> { | |||
91 | .zip(params_ty) | 91 | .zip(params_ty) |
92 | .flat_map(|(pat, param_ty)| { | 92 | .flat_map(|(pat, param_ty)| { |
93 | let pat = pat?; | 93 | let pat = pat?; |
94 | let name = pat.to_string(); | 94 | let name = pat; |
95 | let arg = name.trim_start_matches("mut ").trim_start_matches('_'); | 95 | let arg = name.trim_start_matches("mut ").trim_start_matches('_'); |
96 | Some(self.add_arg(arg, param_ty.ty())) | 96 | Some(self.add_arg(arg, param_ty.ty())) |
97 | }) | 97 | }) |