Skip to content

Commit 1786814

Browse files
committed
chore: address clippy
1 parent 10f6946 commit 1786814

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

datafusion/sql/src/select.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
711711
.iter()
712712
.filter_map(|p| p.as_ident())
713713
.map(|id| self.ident_normalizer.normalize(id.clone()))
714-
.last()?;
714+
.next_back()?;
715715
Some((table_name, span))
716716
}
717717
_ => None,
@@ -745,17 +745,16 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
745745
let right = self.plan_table_with_joins(input, planner_context)?;
746746

747747
left = left.cross_join(right).map_err(|e| {
748-
if let Some((ref name, ref current_span)) = current_name {
749-
if let Some(prior_span) =
748+
if let Some((ref name, ref current_span)) = current_name
749+
&& let Some(prior_span) =
750750
alias_spans.get(name).copied().flatten()
751-
{
752-
let diagnostic = Diagnostic::new_error(
753-
"duplicate table alias in FROM clause",
754-
*current_span,
755-
)
756-
.with_note("first defined here", Some(prior_span));
757-
return e.with_diagnostic(diagnostic);
758-
}
751+
{
752+
let diagnostic = Diagnostic::new_error(
753+
"duplicate table alias in FROM clause",
754+
*current_span,
755+
)
756+
.with_note("first defined here", Some(prior_span));
757+
return e.with_diagnostic(diagnostic);
759758
}
760759
e
761760
})?;

0 commit comments

Comments
 (0)