From 16543ae32063eaedd992614ce5889fdae06a05a1 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Fri, 5 Jul 2024 11:32:52 -0600 Subject: [PATCH] minor: replace .downcast_ref::().is_some() with .is::() --- core/src/execution/datafusion/planner.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/execution/datafusion/planner.rs b/core/src/execution/datafusion/planner.rs index a969c3baa..184f7cffe 100644 --- a/core/src/execution/datafusion/planner.rs +++ b/core/src/execution/datafusion/planner.rs @@ -907,7 +907,7 @@ impl PhysicalPlanner { // the data corruption. Note that we only need to copy the input batch // if the child operator is `ScanExec`, because other operators after `ScanExec` // will create new arrays for the output batch. - let child = if child.as_any().downcast_ref::().is_some() { + let child = if child.as_any().is::() { Arc::new(CopyExec::new(child)) } else { child @@ -1600,10 +1600,10 @@ impl From for DataFusionError { /// modification. This is used to determine if we need to copy the input batch to avoid /// data corruption from reusing the input batch. fn can_reuse_input_batch(op: &Arc) -> bool { - op.as_any().downcast_ref::().is_some() - || op.as_any().downcast_ref::().is_some() - || op.as_any().downcast_ref::().is_some() - || op.as_any().downcast_ref::().is_some() + op.as_any().is::() + || op.as_any().is::() + || op.as_any().is::() + || op.as_any().is::() } /// Collects the indices of the columns in the input schema that are used in the expression