We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c81e4e commit 11a4655Copy full SHA for 11a4655
src/ast/mod.rs
@@ -4505,15 +4505,11 @@ impl fmt::Display for Statement {
4505
write!(f, " OPTIONS({})", display_comma_separated(options))?;
4506
}
4507
4508
- let has_query = query.is_some();
4509
- if *has_as && has_query {
4510
- write!(f, " AS {query}", query = query.clone().unwrap())
4511
- } else if !has_as && has_query {
4512
- write!(f, " {query}", query = query.clone().unwrap())
4513
- } else if *has_as && !has_query {
4514
- write!(f, " AS")
4515
- } else {
4516
- Ok(())
+ match (*has_as, query) {
+ (true, Some(query)) => write!(f, " AS {query}"),
+ (true, None) => f.write_str(" AS"),
+ (false, Some(query)) => write!(f, " {query}"),
+ (false, None) => Ok(()),
4517
4518
4519
Statement::UNCache {
0 commit comments