Skip to content

Commit 3062df1

Browse files
committed
fix: Remove unwraps
1 parent cdba0ac commit 3062df1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

vortex-datafusion/src/convert/exprs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub(crate) fn make_vortex_predicate(
3434
.as_any()
3535
.downcast_ref::<df_expr::DynamicFilterPhysicalExpr>()
3636
{
37-
let current = dynamic_expr.current().unwrap();
38-
if let Some(lit) = current.as_any().downcast_ref::<df_expr::Literal>()
37+
if let Ok(current) = dynamic_expr.current()
38+
&& let Some(lit) = current.as_any().downcast_ref::<df_expr::Literal>()
3939
&& lit.value() == &ScalarValue::Boolean(Some(true))
4040
{
4141
return None;
@@ -131,9 +131,9 @@ impl TryFromDataFusion<dyn PhysicalExpr> for Expression {
131131
if let Some(dynamic_expr) = df
132132
.as_any()
133133
.downcast_ref::<df_expr::DynamicFilterPhysicalExpr>()
134+
&& let Ok(current) = dynamic_expr.current()
134135
{
135-
let current_dynamic_expr = dynamic_expr.current().unwrap();
136-
let returned_expr = Expression::try_from_df(current_dynamic_expr.as_ref())?;
136+
let returned_expr = Expression::try_from_df(current.as_ref())?;
137137
return Ok(returned_expr);
138138
}
139139

0 commit comments

Comments
 (0)