From 680182d0a0853a3a76fd1cae9838feb5b0acf31c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 13 Mar 2020 12:28:13 +0100 Subject: Restore cargo-fmt gating --- crates/ra_hir/src/code_model.rs | 18 +++++++----------- crates/ra_hir/src/semantics.rs | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 9e2fa03f8..2854631c6 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -227,11 +227,9 @@ impl Module { Some((name, def)) } }) - .flat_map(|(name, def)| - ScopeDef::all_items(def) - .into_iter() - .map(move |item| (name.clone(), item)) - ) + .flat_map(|(name, def)| { + ScopeDef::all_items(def).into_iter().map(move |item| (name.clone(), item)) + }) .collect() } @@ -1298,10 +1296,8 @@ impl ScopeDef { let mut items = ArrayVec::new(); match (def.take_types(), def.take_values()) { - (Some(m1), None) => - items.push(ScopeDef::ModuleDef(m1.into())), - (None, Some(m2)) => - items.push(ScopeDef::ModuleDef(m2.into())), + (Some(m1), None) => items.push(ScopeDef::ModuleDef(m1.into())), + (None, Some(m2)) => items.push(ScopeDef::ModuleDef(m2.into())), (Some(m1), Some(m2)) => { // Some items, like unit structs and enum variants, are // returned as both a type and a value. Here we want @@ -1312,8 +1308,8 @@ impl ScopeDef { } else { items.push(ScopeDef::ModuleDef(m1.into())); } - }, - (None, None) => {}, + } + (None, None) => {} }; if let Some(macro_def_id) = def.take_macros() { diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index e83eb1fdc..788bb3eb7 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -349,8 +349,8 @@ impl<'a, DB: HirDatabase> SemanticsScope<'a, DB> { for item in items { f(name.clone(), item); } - return - }, + return; + } resolver::ScopeDef::ImplSelfType(it) => ScopeDef::ImplSelfType(it.into()), resolver::ScopeDef::AdtSelfType(it) => ScopeDef::AdtSelfType(it.into()), resolver::ScopeDef::GenericParam(id) => ScopeDef::GenericParam(TypeParam { id }), -- cgit v1.2.3