Skip to content

Commit a6abb10

Browse files
committed
fix(collapsible-if): collapse nested if in substitute_oeq_class per clippy
1 parent 84175a8 commit a6abb10

File tree

2 files changed

+20
-25
lines changed

2 files changed

+20
-25
lines changed

datafusion/physical-expr/src/equivalence/properties/mod.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -855,18 +855,13 @@ impl EquivalenceProperties {
855855
}
856856
} else if let Some(cast_col) =
857857
r_expr.as_any().downcast_ref::<CastColumnExpr>()
858+
&& cast_col.expr().eq(&sort_expr.expr)
859+
&& CastExpr::check_bigger_cast(
860+
cast_col.target_field().data_type(),
861+
&expr_type,
862+
)
858863
{
859-
if cast_col.expr().eq(&sort_expr.expr)
860-
&& CastExpr::check_bigger_cast(
861-
cast_col.target_field().data_type(),
862-
&expr_type,
863-
)
864-
{
865-
result.push(PhysicalSortExpr::new(
866-
r_expr,
867-
sort_expr.options,
868-
));
869-
}
864+
result.push(PhysicalSortExpr::new(r_expr, sort_expr.options));
870865
}
871866
}
872867
result.push(sort_expr);

datafusion/proto/src/physical_plan/from_proto.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,20 +1070,20 @@ mod tests {
10701070
};
10711071

10721072
// Try to test different strings, but skip if cache fills up
1073-
if format_options_from_proto(&second).is_ok() {
1074-
if let Ok(second_interned) = intern_format_strings(&second) {
1075-
assert!(
1076-
!std::ptr::eq(first_interned.null, second_interned.null),
1077-
"Different null strings should return different pointers"
1078-
);
1079-
assert!(
1080-
!std::ptr::eq(
1081-
first_interned.date_format.unwrap(),
1082-
second_interned.date_format.unwrap()
1083-
),
1084-
"Different date_format strings should return different pointers"
1085-
);
1086-
}
1073+
if format_options_from_proto(&second).is_ok()
1074+
&& let Ok(second_interned) = intern_format_strings(&second)
1075+
{
1076+
assert!(
1077+
!std::ptr::eq(first_interned.null, second_interned.null),
1078+
"Different null strings should return different pointers"
1079+
);
1080+
assert!(
1081+
!std::ptr::eq(
1082+
first_interned.date_format.unwrap(),
1083+
second_interned.date_format.unwrap()
1084+
),
1085+
"Different date_format strings should return different pointers"
1086+
);
10871087
}
10881088
}
10891089
}

0 commit comments

Comments
 (0)