From 73ccf7f495f328e10dca38e0f069de89ab52b9d3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Apr 2020 15:07:18 +0200 Subject: Reorder imports --- crates/ra_ide/src/completion/complete_record.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/completion/complete_record.rs b/crates/ra_ide/src/completion/complete_record.rs index 01dd8c6db..780a98aea 100644 --- a/crates/ra_ide/src/completion/complete_record.rs +++ b/crates/ra_ide/src/completion/complete_record.rs @@ -1,7 +1,8 @@ //! Complete fields in record literals and patterns. -use crate::completion::{CompletionContext, Completions}; use ra_syntax::{ast, ast::NameOwner, SmolStr}; +use crate::completion::{CompletionContext, Completions}; + pub(super) fn complete_record(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { let (ty, variant, already_present_fields) = match (ctx.record_lit_pat.as_ref(), ctx.record_lit_syntax.as_ref()) { @@ -59,9 +60,10 @@ fn pattern_ascribed_fields(record_pat: &ast::RecordPat) -> Vec { #[cfg(test)] mod tests { mod record_lit_tests { - use crate::completion::{test_utils::do_completion, CompletionItem, CompletionKind}; use insta::assert_debug_snapshot; + use crate::completion::{test_utils::do_completion, CompletionItem, CompletionKind}; + fn complete(code: &str) -> Vec { do_completion(code, CompletionKind::Reference) } @@ -204,9 +206,10 @@ mod tests { } mod record_pat_tests { - use crate::completion::{test_utils::do_completion, CompletionItem, CompletionKind}; use insta::assert_debug_snapshot; + use crate::completion::{test_utils::do_completion, CompletionItem, CompletionKind}; + fn complete(code: &str) -> Vec { do_completion(code, CompletionKind::Reference) } -- cgit v1.2.3