fix clippy warnings (#367)

This commit is contained in:
Jiayu Liu 2021-12-08 15:27:00 +08:00 committed by GitHub
parent 9c87d3b195
commit 0e1027ce96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -433,15 +433,14 @@ impl fmt::Display for WindowSpec {
write!(f, "ORDER BY {}", display_comma_separated(&self.order_by))?; write!(f, "ORDER BY {}", display_comma_separated(&self.order_by))?;
} }
if let Some(window_frame) = &self.window_frame { if let Some(window_frame) = &self.window_frame {
if let Some(end_bound) = &window_frame.end_bound {
f.write_str(delim)?; f.write_str(delim)?;
if let Some(end_bound) = &window_frame.end_bound {
write!( write!(
f, f,
"{} BETWEEN {} AND {}", "{} BETWEEN {} AND {}",
window_frame.units, window_frame.start_bound, end_bound window_frame.units, window_frame.start_bound, end_bound
)?; )?;
} else { } else {
f.write_str(delim)?;
write!(f, "{} {}", window_frame.units, window_frame.start_bound)?; write!(f, "{} {}", window_frame.units, window_frame.start_bound)?;
} }
} }

View file

@ -2772,6 +2772,7 @@ impl<'a> Parser<'a> {
// followed by some joins or (B) another level of nesting. // followed by some joins or (B) another level of nesting.
let mut table_and_joins = self.parse_table_and_joins()?; let mut table_and_joins = self.parse_table_and_joins()?;
#[allow(clippy::if_same_then_else)]
if !table_and_joins.joins.is_empty() { if !table_and_joins.joins.is_empty() {
self.expect_token(&Token::RParen)?; self.expect_token(&Token::RParen)?;
Ok(TableFactor::NestedJoin(Box::new(table_and_joins))) // (A) Ok(TableFactor::NestedJoin(Box::new(table_and_joins))) // (A)