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 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'crates/ra_hir/src/code_model.rs') 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() { -- cgit v1.2.3