@@ -145,7 +145,7 @@ impl ChainItemKind {
145
145
146
146
fn from_ast ( context : & RewriteContext < ' _ > , expr : & ast:: Expr ) -> ( ChainItemKind , Span ) {
147
147
let ( kind, span) = match expr. kind {
148
- ast:: ExprKind :: MethodCall ( ref segment, ref expressions, _) => {
148
+ ast:: ExprKind :: MethodCall ( ref segment, ref receiver , ref expressions, _) => {
149
149
let types = if let Some ( ref generic_args) = segment. args {
150
150
if let ast:: GenericArgs :: AngleBracketed ( ref data) = * * generic_args {
151
151
data. args
@@ -163,7 +163,7 @@ impl ChainItemKind {
163
163
} else {
164
164
vec ! [ ]
165
165
} ;
166
- let span = mk_sp ( expressions [ 0 ] . span . hi ( ) , expr. span . hi ( ) ) ;
166
+ let span = mk_sp ( receiver . span . hi ( ) , expr. span . hi ( ) ) ;
167
167
let kind = ChainItemKind :: MethodCall ( segment. clone ( ) , types, expressions. clone ( ) ) ;
168
168
( kind, span)
169
169
}
@@ -253,7 +253,7 @@ impl ChainItem {
253
253
format ! ( "::<{}>" , type_list. join( ", " ) )
254
254
} ;
255
255
let callee_str = format ! ( ".{}{}" , rewrite_ident( context, method_name) , type_str) ;
256
- rewrite_call ( context, & callee_str, & args[ 1 .. ] , span, shape)
256
+ rewrite_call ( context, & callee_str, & args, span, shape)
257
257
}
258
258
}
259
259
@@ -400,8 +400,8 @@ impl Chain {
400
400
// is a try! macro, we'll convert it to shorthand when the option is set.
401
401
fn pop_expr_chain ( expr : & ast:: Expr , context : & RewriteContext < ' _ > ) -> Option < ast:: Expr > {
402
402
match expr. kind {
403
- ast:: ExprKind :: MethodCall ( _, ref expressions , _) => {
404
- Some ( Self :: convert_try ( & expressions [ 0 ] , context) )
403
+ ast:: ExprKind :: MethodCall ( _, ref receiver , _ , _) => {
404
+ Some ( Self :: convert_try ( & receiver , context) )
405
405
}
406
406
ast:: ExprKind :: Field ( ref subexpr, _)
407
407
| ast:: ExprKind :: Try ( ref subexpr)
0 commit comments