Skip to content

Commit

Permalink
Tweak await span
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Apr 27, 2023
1 parent f4c9b4c commit 6b9c151
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 232,7 @@ impl ChainItemKind {
let span = mk_sp(nested.span.hi(), field.span.hi());
(kind, span)
}
ast::ExprKind::Await(ref nested) => {
ast::ExprKind::Await(ref nested, _) => {
let span = mk_sp(nested.span.hi(), expr.span.hi());
(ChainItemKind::Await, span)
}
Expand Down Expand Up @@ -459,7 459,7 @@ impl Chain {
ast::ExprKind::MethodCall(ref call) => Some(Self::convert_try(&call.receiver, context)),
ast::ExprKind::Field(ref subexpr, _)
| ast::ExprKind::Try(ref subexpr)
| ast::ExprKind::Await(ref subexpr) => Some(Self::convert_try(subexpr, context)),
| ast::ExprKind::Await(ref subexpr, _) => Some(Self::convert_try(subexpr, context)),
_ => None,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 218,7 @@ pub(crate) fn format_expr(
ast::ExprKind::Try(..)
| ast::ExprKind::Field(..)
| ast::ExprKind::MethodCall(..)
| ast::ExprKind::Await(_) => rewrite_chain(expr, context, shape),
| ast::ExprKind::Await(_, _) => rewrite_chain(expr, context, shape),
ast::ExprKind::MacCall(ref mac) => {
rewrite_macro(mac, None, context, shape, MacroPosition::Expression).or_else(|| {
wrap_str(
Expand Down Expand Up @@ -1889,7 1889,7 @@ impl<'ast> RhsAssignKind<'ast> {
ast::ExprKind::Try(..)
| ast::ExprKind::Field(..)
| ast::ExprKind::MethodCall(..)
| ast::ExprKind::Await(_)
| ast::ExprKind::Await(_, _)
)
}
_ => false,
Expand Down

0 comments on commit 6b9c151

Please sign in to comment.