From 1834bae5b86c54ed9dece26e82436919d59e6cb7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 4 Jul 2019 23:05:17 +0300 Subject: allow rustfmt to reorder imports This wasn't a right decision in the first place, the feature flag was broken in the last rustfmt release, and syntax highlighting of imports is more important anyway --- crates/ra_hir/src/nameres/collector.rs | 25 +++++++++++-------------- crates/ra_hir/src/nameres/raw.rs | 15 +++++++++------ crates/ra_hir/src/nameres/tests.rs | 6 +++--- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'crates/ra_hir/src/nameres') diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index ef4d1ed70..2b07ebf4a 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs @@ -1,22 +1,19 @@ use arrayvec::ArrayVec; -use rustc_hash::FxHashMap; -use relative_path::RelativePathBuf; -use test_utils::tested_by; use ra_db::FileId; use ra_syntax::ast; +use relative_path::RelativePathBuf; +use rustc_hash::FxHashMap; +use test_utils::tested_by; use crate::{ - Function, Module, Struct, Union, Enum, Const, Static, Trait, TypeAlias, MacroDef, - DefDatabase, HirFileId, Name, Path, - KnownName, AstId, + either::Either, + ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind}, nameres::{ - Resolution, PerNs, ModuleDef, ReachedFixedPoint, ResolveMode, - CrateDefMap, CrateModuleId, ModuleData, ItemOrMacro, - diagnostics::DefDiagnostic, - raw, + diagnostics::DefDiagnostic, raw, CrateDefMap, CrateModuleId, ItemOrMacro, ModuleData, + ModuleDef, PerNs, ReachedFixedPoint, Resolution, ResolveMode, }, - ids::{AstItemDef, LocationCtx, MacroCallLoc, MacroCallId, MacroDefId, MacroFileKind}, - either::Either, + AstId, Const, DefDatabase, Enum, Function, HirFileId, KnownName, MacroDef, Module, Name, Path, + Static, Struct, Trait, TypeAlias, Union, }; pub(super) fn collect_defs(db: &impl DefDatabase, mut def_map: CrateDefMap) -> CrateDefMap { @@ -666,9 +663,9 @@ fn resolve_submodule( mod tests { use ra_db::SourceDatabase; - use crate::{Crate, mock::MockDatabase, DefDatabase}; - use ra_arena::{Arena}; use super::*; + use crate::{mock::MockDatabase, Crate, DefDatabase}; + use ra_arena::Arena; use rustc_hash::FxHashSet; fn do_collect_defs( diff --git a/crates/ra_hir/src/nameres/raw.rs b/crates/ra_hir/src/nameres/raw.rs index a0afe282c..7ea59cb75 100644 --- a/crates/ra_hir/src/nameres/raw.rs +++ b/crates/ra_hir/src/nameres/raw.rs @@ -1,13 +1,16 @@ -use std::{sync::Arc, ops::Index}; +use std::{ops::Index, sync::Arc}; -use test_utils::tested_by; -use ra_arena::{Arena, impl_arena_id, RawId, map::ArenaMap}; +use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; use ra_syntax::{ - AstNode, SourceFile, AstPtr, TreeArc, - ast::{self, NameOwner, AttrsOwner}, + ast::{self, AttrsOwner, NameOwner}, + AstNode, AstPtr, SourceFile, TreeArc, }; +use test_utils::tested_by; -use crate::{DefDatabase, Name, AsName, Path, HirFileId, ModuleSource, AstIdMap, FileAstId, Either, AstDatabase}; +use crate::{ + AsName, AstDatabase, AstIdMap, DefDatabase, Either, FileAstId, HirFileId, ModuleSource, Name, + Path, +}; /// `RawItems` is a set of top-level items in a file (except for impls). /// diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index adac814d9..953610b37 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs @@ -5,14 +5,14 @@ mod primitives; use std::sync::Arc; +use insta::assert_snapshot_matches; use ra_db::SourceDatabase; use test_utils::covers; -use insta::assert_snapshot_matches; use crate::{ - Crate, Either, - mock::{MockDatabase, CrateGraphFixture}, + mock::{CrateGraphFixture, MockDatabase}, nameres::Resolution, + Crate, Either, }; use super::*; -- cgit v1.2.3