@@ -74,8 +74,8 @@ use rewrite::{Rewrite, RewriteContext};
74
74
use shape:: Shape ;
75
75
use source_map:: SpanUtils ;
76
76
use utils:: {
77
- first_line_width, last_line_extendable, last_line_width, mk_sp, trimmed_last_line_width ,
78
- wrap_str,
77
+ first_line_width, last_line_extendable, last_line_width, mk_sp, rewrite_ident ,
78
+ trimmed_last_line_width , wrap_str,
79
79
} ;
80
80
81
81
use std:: borrow:: Cow ;
@@ -190,10 +190,12 @@ impl Rewrite for ChainItem {
190
190
ChainItemKind :: MethodCall ( ref segment, ref types, ref exprs) => {
191
191
Self :: rewrite_method_call ( segment. ident , types, exprs, self . span , context, shape) ?
192
192
}
193
- ChainItemKind :: StructField ( ident) => format ! ( ".{}" , ident. name) ,
194
- ChainItemKind :: TupleField ( ident, nested) => {
195
- format ! ( "{}.{}" , if nested { " " } else { "" } , ident. name)
196
- }
193
+ ChainItemKind :: StructField ( ident) => format ! ( ".{}" , rewrite_ident( context, ident) ) ,
194
+ ChainItemKind :: TupleField ( ident, nested) => format ! (
195
+ "{}.{}" ,
196
+ if nested { " " } else { "" } ,
197
+ rewrite_ident( context, ident)
198
+ ) ,
197
199
ChainItemKind :: Comment ( ref comment, _) => {
198
200
rewrite_comment ( comment, false , shape, context. config ) ?
199
201
}
@@ -241,7 +243,7 @@ impl ChainItem {
241
243
242
244
format ! ( "::<{}>" , type_list. join( ", " ) )
243
245
} ;
244
- let callee_str = format ! ( ".{}{}" , method_name, type_str) ;
246
+ let callee_str = format ! ( ".{}{}" , rewrite_ident ( context , method_name) , type_str) ;
245
247
rewrite_call ( context, & callee_str, & args[ 1 ..] , span, shape)
246
248
}
247
249
}
0 commit comments