@@ -67,31 +67,32 @@ fn to_str_substructure(cx: &mut ExtCtxt, span: Span, substr: &Substructure)
67
67
let mut stmts = ~[ cx. stmt_let ( span, true , buf, init) ] ;
68
68
let push_str = cx. ident_of ( "push_str" ) ;
69
69
70
- let push = |s : @Expr | {
71
- let ebuf = cx. expr_ident ( span, buf) ;
72
- let call = cx. expr_method_call ( span, ebuf, push_str, ~[ s] ) ;
73
- stmts. push ( cx. stmt_expr ( call) ) ;
74
- } ;
70
+ {
71
+ let push = |s : @Expr | {
72
+ let ebuf = cx. expr_ident ( span, buf) ;
73
+ let call = cx. expr_method_call ( span, ebuf, push_str, ~[ s] ) ;
74
+ stmts. push ( cx. stmt_expr ( call) ) ;
75
+ } ;
75
76
76
- for ( i, & FieldInfo { name, span, self_, .. } ) in fields. iter ( ) . enumerate ( ) {
77
- if i > 0 {
78
- push ( cx. expr_str ( span, InternedString :: new ( ", " ) ) ) ;
79
- }
80
- match name {
81
- None => { }
82
- Some ( id) => {
83
- let interned_id = token:: get_ident ( id. name ) ;
84
- let name = interned_id. get ( ) + ": " ;
85
- push ( cx. expr_str ( span,
86
- token:: intern_and_get_ident ( name) ) ) ;
77
+ for ( i, & FieldInfo { name, span, self_, .. } ) in fields. iter ( ) . enumerate ( ) {
78
+ if i > 0 {
79
+ push ( cx. expr_str ( span, InternedString :: new ( ", " ) ) ) ;
80
+ }
81
+ match name {
82
+ None => { }
83
+ Some ( id) => {
84
+ let interned_id = token:: get_ident ( id. name ) ;
85
+ let name = interned_id. get ( ) + ": " ;
86
+ push ( cx. expr_str ( span,
87
+ token:: intern_and_get_ident ( name) ) ) ;
88
+ }
87
89
}
90
+ push ( cx. expr_method_call ( span, self_, to_str, ~[ ] ) ) ;
88
91
}
89
- push ( cx. expr_method_call ( span, self_ , to_str , ~ [ ] ) ) ;
92
+ push ( cx. expr_str ( span, end ) ) ;
90
93
}
91
- push ( cx. expr_str ( span, end) ) ;
92
94
93
- cx. expr_block ( cx. block ( span, stmts, Some ( cx. expr_ident ( span,
94
- buf) ) ) )
95
+ cx. expr_block ( cx. block ( span, stmts, Some ( cx. expr_ident ( span, buf) ) ) )
95
96
}
96
97
} ;
97
98
0 commit comments