Skip to content

Commit 903d815

Browse files
committed
Clean up
1 parent 4dbda06 commit 903d815

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src/visitor.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ use comment::{contains_comment, recover_missing_comment_in_span, CodeCharKind, C
2222
FindUncommented};
2323
use comment::rewrite_comment;
2424
use config::{BraceStyle, Config};
25-
use items::{format_impl, format_trait, rewrite_associated_impl_type, rewrite_associated_type,
26-
rewrite_static, rewrite_type_alias};
25+
use items::{format_impl, format_struct, format_struct_struct, format_trait,
26+
rewrite_associated_impl_type, rewrite_associated_type, rewrite_static,
27+
rewrite_type_alias};
2728
use lists::{itemize_list, write_list, DefinitiveListTactic, ListFormatting, SeparatorPlace,
2829
SeparatorTactic};
2930
use macros::{rewrite_macro, MacroPosition};
@@ -361,22 +362,20 @@ impl<'a> FmtVisitor<'a> {
361362
self.push_rewrite(item.span, rw);
362363
}
363364
ast::ItemKind::Struct(ref def, ref generics) => {
364-
let rewrite = {
365-
::items::format_struct(
366-
&self.get_context(),
367-
"struct ",
368-
item.ident,
369-
&item.vis,
370-
def,
371-
Some(generics),
372-
item.span,
373-
self.block_indent,
374-
None,
375-
).map(|s| match *def {
376-
ast::VariantData::Tuple(..) => s + ";",
377-
_ => s,
378-
})
379-
};
365+
let rewrite = format_struct(
366+
&self.get_context(),
367+
"struct ",
368+
item.ident,
369+
&item.vis,
370+
def,
371+
Some(generics),
372+
item.span,
373+
self.block_indent,
374+
None,
375+
).map(|s| match *def {
376+
ast::VariantData::Tuple(..) => s + ";",
377+
_ => s,
378+
});
380379
self.push_rewrite(item.span, rewrite);
381380
}
382381
ast::ItemKind::Enum(ref def, ref generics) => {
@@ -457,7 +456,7 @@ impl<'a> FmtVisitor<'a> {
457456
self.push_rewrite(item.span, rewrite);
458457
}
459458
ast::ItemKind::Union(ref def, ref generics) => {
460-
let rewrite = ::items::format_struct_struct(
459+
let rewrite = format_struct_struct(
461460
&self.get_context(),
462461
"union ",
463462
item.ident,

0 commit comments

Comments
 (0)