@@ -19,7 +19,7 @@ use {Indent, Shape};
19
19
use codemap:: { LineRangeUtils , SpanUtils } ;
20
20
use comment:: { contains_comment, FindUncommented } ;
21
21
use comment:: rewrite_comment;
22
- use config:: Config ;
22
+ use config:: { BraceStyle , Config } ;
23
23
use expr:: { format_expr, ExprType } ;
24
24
use items:: { format_impl, format_trait, rewrite_associated_impl_type, rewrite_associated_type,
25
25
rewrite_static, rewrite_type_alias} ;
@@ -665,7 +665,11 @@ impl<'a> FmtVisitor<'a> {
665
665
self . buffer . push_str ( & ident. to_string ( ) ) ;
666
666
667
667
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
+ }
669
673
// Hackery to account for the closing }.
670
674
let mod_lo = self . codemap . span_after ( source ! ( self , s) , "{" ) ;
671
675
let body_snippet = self . snippet ( mk_sp ( mod_lo, source ! ( self , m. inner) . hi - BytePos ( 1 ) ) ) ;
0 commit comments