aboutsummaryrefslogtreecommitdiff
path: root/crates/completion
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-12-12 17:27:09 +0000
committerJeremy Kolb <[email protected]>2020-12-12 17:27:09 +0000
commit26a1675764c9f96cc96d75d2129dd6c828b8df51 (patch)
treee53212d4569e73c7337bb205e937174f425fda5b /crates/completion
parent479d1f7eec22c3564867223e2093f14774092528 (diff)
Remove some redundant allocations
Diffstat (limited to 'crates/completion')
-rw-r--r--crates/completion/src/completions/unqualified_path.rs2
-rw-r--r--crates/completion/src/render/function.rs2
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 })