Fix broken is_expression_parenthesized call from rebase (#7442)

This commit is contained in:
Charlie Marsh 2023-09-16 13:22:16 -04:00 committed by GitHub
parent 7e2eba2592
commit aae02cf275
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,11 @@ impl NeedsParentheses for ExprAwait {
) -> OptionalParentheses {
if parent.is_expr_await() {
OptionalParentheses::Always
} else if is_expression_parenthesized(self.value.as_ref().into(), context.source()) {
} else if is_expression_parenthesized(
self.value.as_ref().into(),
context.comments().ranges(),
context.source(),
) {
OptionalParentheses::Never
} else {
self.value.needs_parentheses(self.into(), context)