Remove some redundant allocations

This commit is contained in:
Jeremy Kolb 2020-12-12 12:27:09 -05:00
parent 479d1f7eec
commit 26a1675764
10 changed files with 9 additions and 10 deletions

View file

@ -147,7 +147,7 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()
.filter_map(|(import_path, definition)| {
render_resolution_with_import(
RenderContext::new(ctx),
ImportEdit { import_path: import_path.clone(), import_scope: import_scope.clone() },
ImportEdit { import_path, import_scope: import_scope.clone() },
&definition,
)
});

View file

@ -91,7 +91,7 @@ impl<'a> FunctionRender<'a> {
.zip(params_ty)
.flat_map(|(pat, param_ty)| {
let pat = pat?;
let name = pat.to_string();
let name = pat;
let arg = name.trim_start_matches("mut ").trim_start_matches('_');
Some(self.add_arg(arg, param_ty.ty()))
})