ChainItemKind::MethodCall(..)
| ChainItemKind::StructField(..)
| ChainItemKind::TupleField(..)
ChainItemKind::MethodCall(..)
| ChainItemKind::StructField(..)
| ChainItemKind::TupleField(..)
+ ast::ExprKind::Await(ast::AwaitOrigin::FieldLike, ref nested) => {
+ let span = mk_sp(nested.span.hi(), expr.span.hi());
+ (ChainItemKind::Await, span)
+ }
if nested { " " } else { "" },
rewrite_ident(context, ident)
),
if nested { " " } else { "" },
rewrite_ident(context, ident)
),
ChainItemKind::Comment(ref comment, _) => {
rewrite_comment(comment, false, shape, context.config)?
}
ChainItemKind::Comment(ref comment, _) => {
rewrite_comment(comment, false, shape, context.config)?
}
ast::ExprKind::MethodCall(_, ref expressions) => {
Some(Self::convert_try(&expressions[0], context))
}
ast::ExprKind::MethodCall(_, ref expressions) => {
Some(Self::convert_try(&expressions[0], context))
}
- ast::ExprKind::Field(ref subexpr, _) | ast::ExprKind::Try(ref subexpr) => {
+ ast::ExprKind::Field(ref subexpr, _)
+ | ast::ExprKind::Try(ref subexpr)
+ | ast::ExprKind::Await(ast::AwaitOrigin::FieldLike, ref subexpr) => {
// Parent is the first item in the chain, e.g., `foo` in `foo.bar.baz()`.
// Root is the parent plus any other chain items placed on the first line to
// avoid an orphan. E.g.,
// Parent is the first item in the chain, e.g., `foo` in `foo.bar.baz()`.
// Root is the parent plus any other chain items placed on the first line to
// avoid an orphan. E.g.,
// know whether 'overflowing' the last child make a better formatting:
//
// A chain with overflowing the last child:
// know whether 'overflowing' the last child make a better formatting:
//
// A chain with overflowing the last child:
//
// In particular, overflowing is effective when the last child is a method with a multi-lined
// block-like argument (e.g., closure):
//
// In particular, overflowing is effective when the last child is a method with a multi-lined
// block-like argument (e.g., closure):