about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authortopecongiro <seuchida@gmail.com>2017-09-06 19:30:51 +0900
committertopecongiro <seuchida@gmail.com>2017-09-06 19:30:51 +0900
commit903d815228d6d3a0afdce19defe5beafe9b039da (patch)
treec653b536a9278dc36e867506f6e460319dfd1f29 /src
parent4dbda0662964e02e02c2b1891cd1332966fef658 (diff)
Clean up
Diffstat (limited to 'src')
-rw-r--r--src/visitor.rs37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/visitor.rs b/src/visitor.rs
index f4288d84462..aff768f450c 100644
--- a/src/visitor.rs
+++ b/src/visitor.rs
@@ -22,8 +22,9 @@ use comment::{contains_comment, recover_missing_comment_in_span, CodeCharKind, C
               FindUncommented};
 use comment::rewrite_comment;
 use config::{BraceStyle, Config};
-use items::{format_impl, format_trait, rewrite_associated_impl_type, rewrite_associated_type,
-            rewrite_static, rewrite_type_alias};
+use items::{format_impl, format_struct, format_struct_struct, format_trait,
+            rewrite_associated_impl_type, rewrite_associated_type, rewrite_static,
+            rewrite_type_alias};
 use lists::{itemize_list, write_list, DefinitiveListTactic, ListFormatting, SeparatorPlace,
             SeparatorTactic};
 use macros::{rewrite_macro, MacroPosition};
@@ -361,22 +362,20 @@ impl<'a> FmtVisitor<'a> {
                 self.push_rewrite(item.span, rw);
             }
             ast::ItemKind::Struct(ref def, ref generics) => {
-                let rewrite = {
-                    ::items::format_struct(
-                        &self.get_context(),
-                        "struct ",
-                        item.ident,
-                        &item.vis,
-                        def,
-                        Some(generics),
-                        item.span,
-                        self.block_indent,
-                        None,
-                    ).map(|s| match *def {
-                        ast::VariantData::Tuple(..) => s + ";",
-                        _ => s,
-                    })
-                };
+                let rewrite = format_struct(
+                    &self.get_context(),
+                    "struct ",
+                    item.ident,
+                    &item.vis,
+                    def,
+                    Some(generics),
+                    item.span,
+                    self.block_indent,
+                    None,
+                ).map(|s| match *def {
+                    ast::VariantData::Tuple(..) => s + ";",
+                    _ => s,
+                });
                 self.push_rewrite(item.span, rewrite);
             }
             ast::ItemKind::Enum(ref def, ref generics) => {
@@ -457,7 +456,7 @@ impl<'a> FmtVisitor<'a> {
                 self.push_rewrite(item.span, rewrite);
             }
             ast::ItemKind::Union(ref def, ref generics) => {
-                let rewrite = ::items::format_struct_struct(
+                let rewrite = format_struct_struct(
                     &self.get_context(),
                     "union ",
                     item.ident,