mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Remove some redundant allocations
This commit is contained in:
parent
479d1f7eec
commit
26a1675764
10 changed files with 9 additions and 10 deletions
|
@ -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,
|
||||
)
|
||||
});
|
||||
|
|
|
@ -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()))
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue