Skip to content

Commit 1e00a28

Browse files
committed
Apply item_brace_style to mod
1 parent cf195fb commit 1e00a28

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/visitor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {Indent, Shape};
1919
use codemap::{LineRangeUtils, SpanUtils};
2020
use comment::{contains_comment, FindUncommented};
2121
use comment::rewrite_comment;
22-
use config::Config;
22+
use config::{BraceStyle, Config};
2323
use expr::{format_expr, ExprType};
2424
use items::{format_impl, format_trait, rewrite_associated_impl_type, rewrite_associated_type,
2525
rewrite_static, rewrite_type_alias};
@@ -665,7 +665,11 @@ impl<'a> FmtVisitor<'a> {
665665
self.buffer.push_str(&ident.to_string());
666666

667667
if is_internal {
668-
self.buffer.push_str(" {");
668+
match self.config.item_brace_style() {
669+
BraceStyle::AlwaysNextLine => self.buffer
670+
.push_str(&format!("\n{}{{", self.block_indent.to_string(self.config))),
671+
_ => self.buffer.push_str(" {"),
672+
}
669673
// Hackery to account for the closing }.
670674
let mod_lo = self.codemap.span_after(source!(self, s), "{");
671675
let body_snippet = self.snippet(mk_sp(mod_lo, source!(self, m.inner).hi - BytePos(1)));

0 commit comments

Comments
 (0)