]> git.lizzy.rs Git - rust.git/blobdiff - src/reorder.rs
Change `print_diff` to output the correct line number.
[rust.git] / src / reorder.rs
index b6876738cfd6a2236bf8c3cab8a45f98979df1d1..47aae3bfc2ad099c43b30482ce7a601a8bad32fd 100644 (file)
@@ -193,12 +193,12 @@ fn from(item: &ast::Item) -> Self {
         }
     }
 
-    fn is_same_item_kind(&self, item: &ast::Item) -> bool {
-        ReorderableItemKind::from(item) == *self
+    fn is_same_item_kind(self, item: &ast::Item) -> bool {
+        ReorderableItemKind::from(item) == self
     }
 
-    fn is_reorderable(&self, config: &Config) -> bool {
-        match *self {
+    fn is_reorderable(self, config: &Config) -> bool {
+        match self {
             ReorderableItemKind::ExternCrate => config.reorder_imports(),
             ReorderableItemKind::Mod => config.reorder_modules(),
             ReorderableItemKind::Use => config.reorder_imports(),
@@ -206,8 +206,8 @@ fn is_reorderable(&self, config: &Config) -> bool {
         }
     }
 
-    fn in_group(&self) -> bool {
-        match *self {
+    fn in_group(self) -> bool {
+        match self {
             ReorderableItemKind::ExternCrate
             | ReorderableItemKind::Mod
             | ReorderableItemKind::Use => true,