From 99c4a41cd1a9f9ef0ee4f067f0069a23123b949a Mon Sep 17 00:00:00 2001 From: yonip23 Date: Thu, 11 Mar 2021 17:46:41 +0200 Subject: use references in CompletionItem's builder --- crates/ide_completion/src/completions/record.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'crates/ide_completion/src/completions/record.rs') diff --git a/crates/ide_completion/src/completions/record.rs b/crates/ide_completion/src/completions/record.rs index 0a7927eb8..b9af09698 100644 --- a/crates/ide_completion/src/completions/record.rs +++ b/crates/ide_completion/src/completions/record.rs @@ -22,16 +22,13 @@ pub(crate) fn complete_record(acc: &mut Completions, ctx: &CompletionContext) -> let completion_text = completion_text .strip_prefix(ctx.token.to_string().as_str()) .unwrap_or(completion_text); - acc.add( - CompletionItem::new( - CompletionKind::Snippet, - ctx.source_range(), - "..Default::default()", - ) - .insert_text(completion_text) - .kind(SymbolKind::Field) - .build(), + let mut builder = CompletionItem::new( + CompletionKind::Snippet, + ctx.source_range(), + "..Default::default()", ); + builder.insert_text(completion_text).kind(SymbolKind::Field); + acc.add(builder.build()); } missing_fields -- cgit v1.2.3