diff --git a/crates/ide_completion/src/completions.rs b/crates/ide_completion/src/completions.rs index 0f0553a65c7..dd92bc51097 100644 --- a/crates/ide_completion/src/completions.rs +++ b/crates/ide_completion/src/completions.rs @@ -74,7 +74,7 @@ pub(crate) fn add_all(&mut self, items: I) pub(crate) fn add_field( &mut self, ctx: &CompletionContext, - receiver: Option, + receiver: Option, field: hir::Field, ty: &hir::Type, ) { @@ -85,7 +85,7 @@ pub(crate) fn add_field( pub(crate) fn add_tuple_field( &mut self, ctx: &CompletionContext, - receiver: Option, + receiver: Option, field: usize, ty: &hir::Type, ) { @@ -141,7 +141,7 @@ pub(crate) fn add_method( &mut self, ctx: &CompletionContext, func: hir::Function, - receiver: Option, + receiver: Option, local_name: Option, ) { if let Some(item) = render_method(RenderContext::new(ctx), None, receiver, local_name, func) diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs index 573a399964f..83cb671010b 100644 --- a/crates/ide_completion/src/completions/unqualified_path.rs +++ b/crates/ide_completion/src/completions/unqualified_path.rs @@ -52,14 +52,14 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC let ty = local.ty(ctx.db); super::complete_fields(ctx, &ty, |field, ty| match field { either::Either::Left(field) => { - acc.add_field(ctx, Some(name.to_string()), field, &ty) + acc.add_field(ctx, Some(name.clone()), field, &ty) } either::Either::Right(tuple_idx) => { - acc.add_tuple_field(ctx, Some(name.to_string()), tuple_idx, &ty) + acc.add_tuple_field(ctx, Some(name.clone()), tuple_idx, &ty) } }); super::complete_methods(ctx, &ty, |func| { - acc.add_method(ctx, func, Some(name.to_string()), None) + acc.add_method(ctx, func, Some(name.clone()), None) }); } } diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs index bf59ff57b1b..97dd528515c 100644 --- a/crates/ide_completion/src/render.rs +++ b/crates/ide_completion/src/render.rs @@ -25,7 +25,7 @@ pub(crate) fn render_field<'a>( ctx: RenderContext<'a>, - receiver: Option, + receiver: Option, field: hir::Field, ty: &hir::Type, ) -> CompletionItem { @@ -34,7 +34,7 @@ pub(crate) fn render_field<'a>( pub(crate) fn render_tuple_field<'a>( ctx: RenderContext<'a>, - receiver: Option, + receiver: Option, field: usize, ty: &hir::Type, ) -> CompletionItem { @@ -130,7 +130,7 @@ fn new(ctx: RenderContext<'a>) -> Render<'a> { fn render_field( &self, - receiver: Option, + receiver: Option, field: hir::Field, ty: &hir::Type, ) -> CompletionItem { @@ -163,7 +163,7 @@ fn render_field( fn render_tuple_field( &self, - receiver: Option, + receiver: Option, field: usize, ty: &hir::Type, ) -> CompletionItem { diff --git a/crates/ide_completion/src/render/function.rs b/crates/ide_completion/src/render/function.rs index b3ba6114d91..3ec77ca0f4a 100644 --- a/crates/ide_completion/src/render/function.rs +++ b/crates/ide_completion/src/render/function.rs @@ -26,7 +26,7 @@ pub(crate) fn render_fn<'a>( pub(crate) fn render_method<'a>( ctx: RenderContext<'a>, import_to_add: Option, - receiver: Option, + receiver: Option, local_name: Option, fn_: hir::Function, ) -> Option { @@ -38,7 +38,7 @@ pub(crate) fn render_method<'a>( struct FunctionRender<'a> { ctx: RenderContext<'a>, name: String, - receiver: Option, + receiver: Option, func: hir::Function, ast_node: Fn, is_method: bool, @@ -47,7 +47,7 @@ struct FunctionRender<'a> { impl<'a> FunctionRender<'a> { fn new( ctx: RenderContext<'a>, - receiver: Option, + receiver: Option, local_name: Option, fn_: hir::Function, is_method: bool,