alamb commented on code in PR #2533:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2533#discussion_r4061439474
##########
src/ast/mod.rs:
##########
@@ -1961,6 +1961,7 @@ impl fmt::Display for Expr {
} else if matches!(
Review Comment:
As a stylistic suggestion here to avoid issues in the future, I suggest
changing the structure of this code to a sigle `match` so we can explicitly see
which operators are handled in what form
like
```rust
match op {
UnaryOperator::PGPostfixFactorial => write!(f, "{expr}{op}"),
UnaryOperator::Not
| UnaryOperator::BitwiseNot
| UnaryOperator::Hash
| UnaryOperator::AtDashAt
| UnaryOperator::DoubleAt
| UnaryOperator::QuestionDash
| UnaryOperator::QuestionPipe => write!(f, "{op}
{expr}"
// TODO explcitly list out the other operators here so the list is
explicitl
}
```
Also when I was typing that it seems like UnaryOperator::PGPostfixFactorial
is the same as the else match 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]