From 305c6405534f9b33f44ccb5b9de87bd00f006ef3 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 11 Apr 2018 10:50:19 +1200 Subject: [PATCH] Review changes --- Configurations.md | 5 +++-- src/config/mod.rs | 2 +- src/reorder.rs | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Configurations.md b/Configurations.md index 8ace886a98f..26d540b70b5 100644 --- a/Configurations.md +++ b/Configurations.md @@ -1243,9 +1243,10 @@ fn adipiscing() -> usize {} ## `reorder_imports` -Reorder import and extern crate statements alphabetically +Reorder import and extern crate statements alphabetically in groups (a group is +separated by a newline). -- **Default value**: `false` +- **Default value**: `true` - **Possible values**: `true`, `false` - **Stable**: No diff --git a/src/config/mod.rs b/src/config/mod.rs index 63a75f880b6..62d025ad5a1 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -68,9 +68,9 @@ imports_layout: ListTactic, ListTactic::Mixed, false, "Item layout inside a import block"; // Ordering - reorder_impl_items: bool, false, false, "Reorder impl items"; reorder_imports: bool, true, false, "Reorder import and extern crate statements alphabetically"; reorder_modules: bool, true, false, "Reorder module statements alphabetically in group"; + reorder_impl_items: bool, false, false, "Reorder impl items"; // Spaces around punctuation type_punctuation_density: TypeDensity, TypeDensity::Wide, false, diff --git a/src/reorder.rs b/src/reorder.rs index e4065146cc6..ed307e679dd 100644 --- a/src/reorder.rs +++ b/src/reorder.rs @@ -207,9 +207,9 @@ pub fn is_reorderable(&self, config: &Config) -> bool { pub fn in_group(&self) -> bool { match *self { - ReorderableItemKind::ExternCrate => true, - ReorderableItemKind::Mod => true, - ReorderableItemKind::Use => true, + ReorderableItemKind::ExternCrate + | ReorderableItemKind::Mod + | ReorderableItemKind::Use => true, ReorderableItemKind::Other => false, } }