Skip to content

Commit f27a050

Browse files
authored
fix: lint for rust 1.95 (#334)
1 parent fe83376 commit f27a050

1 file changed

Lines changed: 23 additions & 30 deletions

File tree

datafusion-pg-catalog/src/sql/rules.rs

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,15 @@ impl ResolveUnqualifiedIdentifer {
269269
projection_aliases: &HashSet<String>,
270270
) {
271271
match expr {
272-
Expr::Identifier(ident) => {
273-
// If the identifier is not a table alias itself and not already aliased in projection, rewrite it.
272+
// If the identifier is not a table alias itself and not already aliased in projection, rewrite it.
273+
Expr::Identifier(ident)
274274
if !table_aliases.contains(&ident.value)
275-
&& !projection_aliases.contains(&ident.value)
276-
{
277-
*expr = Expr::CompoundIdentifier(vec![
278-
Ident::new(wildcard_alias.to_string()),
279-
ident.clone(),
280-
]);
281-
}
275+
&& !projection_aliases.contains(&ident.value) =>
276+
{
277+
*expr = Expr::CompoundIdentifier(vec![
278+
Ident::new(wildcard_alias.to_string()),
279+
ident.clone(),
280+
]);
282281
}
283282
Expr::BinaryOp { left, right, .. } => {
284283
Self::rewrite_expr(left, wildcard_alias, table_aliases, projection_aliases);
@@ -347,27 +346,23 @@ impl VisitorMut for RemoveUnsupportedTypesVisitor<'_> {
347346
data_type,
348347
value,
349348
uses_odbc_syntax: _,
350-
}) => {
351-
if self
352-
.unsupported_types
353-
.contains(data_type.to_string().to_lowercase().as_str())
354-
{
355-
*expr =
356-
Expr::Value(Value::SingleQuotedString(value.to_string()).with_empty_span());
357-
}
349+
}) if self
350+
.unsupported_types
351+
.contains(data_type.to_string().to_lowercase().as_str()) =>
352+
{
353+
*expr = Expr::Value(Value::SingleQuotedString(value.to_string()).with_empty_span());
358354
}
359355
Expr::Cast {
360356
data_type,
361357
expr: value,
362358
..
363-
} => {
364-
if self
365-
.unsupported_types
366-
.contains(data_type.to_string().to_lowercase().as_str())
367-
{
368-
*expr = *value.clone();
369-
}
359+
} if self
360+
.unsupported_types
361+
.contains(data_type.to_string().to_lowercase().as_str()) =>
362+
{
363+
*expr = *value.clone();
370364
}
365+
371366
// Add more match arms for other expression types (e.g., `Function`, `InList`) as needed.
372367
_ => {}
373368
}
@@ -1007,12 +1002,10 @@ impl Visitor for CorrelationCheckVisitor<'_> {
10071002
}) => {
10081003
*self.0 = true;
10091004
}
1010-
Expr::CompoundIdentifier(idents) => {
1011-
if !idents.is_empty() {
1012-
let table_name = &idents[0].value;
1013-
if !self.1.contains(table_name) {
1014-
*self.0 = true;
1015-
}
1005+
Expr::CompoundIdentifier(idents) if !idents.is_empty() => {
1006+
let table_name = &idents[0].value;
1007+
if !self.1.contains(table_name) {
1008+
*self.0 = true;
10161009
}
10171010
}
10181011
_ => {}

0 commit comments

Comments
 (0)