diff --git a/datafusion/core/src/physical_optimizer/enforce_distribution.rs b/datafusion/core/src/physical_optimizer/enforce_distribution.rs index 6f35a97fac24..55976d4fa543 100644 --- a/datafusion/core/src/physical_optimizer/enforce_distribution.rs +++ b/datafusion/core/src/physical_optimizer/enforce_distribution.rs @@ -1410,7 +1410,7 @@ impl DistributionContext { impl TreeNode for DistributionContext { fn children_nodes(&self) -> Vec { - self.children_nodes.iter().map(|c| c.clone()).collect() + self.children_nodes.to_vec() } fn map_children(mut self, transform: F) -> Result @@ -1474,7 +1474,7 @@ impl PlanWithKeyRequirements { impl TreeNode for PlanWithKeyRequirements { fn children_nodes(&self) -> Vec { - self.children.iter().map(|c| c.clone()).collect() + self.children.to_vec() } fn map_children(mut self, transform: F) -> Result diff --git a/datafusion/core/src/physical_optimizer/enforce_sorting.rs b/datafusion/core/src/physical_optimizer/enforce_sorting.rs index 52b59969139a..270db054e2c9 100644 --- a/datafusion/core/src/physical_optimizer/enforce_sorting.rs +++ b/datafusion/core/src/physical_optimizer/enforce_sorting.rs @@ -146,7 +146,7 @@ impl PlanWithCorrespondingSort { impl TreeNode for PlanWithCorrespondingSort { fn children_nodes(&self) -> Vec { - self.children_nodes.iter().map(|c| c.clone()).collect() + self.children_nodes.to_vec() } fn map_children(mut self, transform: F) -> Result @@ -227,7 +227,7 @@ impl PlanWithCorrespondingCoalescePartitions { impl TreeNode for PlanWithCorrespondingCoalescePartitions { fn children_nodes(&self) -> Vec { - self.children_nodes.iter().map(|c| c.clone()).collect() + self.children_nodes.to_vec() } fn map_children(mut self, transform: F) -> Result diff --git a/datafusion/core/src/physical_optimizer/pipeline_checker.rs b/datafusion/core/src/physical_optimizer/pipeline_checker.rs index 01664e4bbd18..5d263ad90394 100644 --- a/datafusion/core/src/physical_optimizer/pipeline_checker.rs +++ b/datafusion/core/src/physical_optimizer/pipeline_checker.rs @@ -92,7 +92,7 @@ impl PipelineStatePropagator { impl TreeNode for PipelineStatePropagator { fn children_nodes(&self) -> Vec { - self.children.iter().map(|c| c.clone()).collect() + self.children.to_vec() } fn map_children(mut self, transform: F) -> Result diff --git a/datafusion/core/src/physical_optimizer/replace_with_order_preserving_variants.rs b/datafusion/core/src/physical_optimizer/replace_with_order_preserving_variants.rs index ae946195c043..b995b06a7b6e 100644 --- a/datafusion/core/src/physical_optimizer/replace_with_order_preserving_variants.rs +++ b/datafusion/core/src/physical_optimizer/replace_with_order_preserving_variants.rs @@ -105,7 +105,7 @@ impl OrderPreservationContext { impl TreeNode for OrderPreservationContext { fn children_nodes(&self) -> Vec { - self.children_nodes.iter().map(|c| c.clone()).collect() + self.children_nodes.to_vec() } fn map_children(mut self, transform: F) -> Result diff --git a/datafusion/core/src/physical_optimizer/sort_pushdown.rs b/datafusion/core/src/physical_optimizer/sort_pushdown.rs index 441abec040f1..532ff9480f28 100644 --- a/datafusion/core/src/physical_optimizer/sort_pushdown.rs +++ b/datafusion/core/src/physical_optimizer/sort_pushdown.rs @@ -72,7 +72,7 @@ impl SortPushDown { impl TreeNode for SortPushDown { fn children_nodes(&self) -> Vec { - self.children_nodes.iter().map(|c| c.clone()).collect() + self.children_nodes.to_vec() } fn map_children(mut self, transform: F) -> Result diff --git a/datafusion/expr/src/tree_node/plan.rs b/datafusion/expr/src/tree_node/plan.rs index d994b1367944..1ae3be0df6ad 100644 --- a/datafusion/expr/src/tree_node/plan.rs +++ b/datafusion/expr/src/tree_node/plan.rs @@ -23,7 +23,7 @@ use datafusion_common::{tree_node::TreeNode, Result}; impl TreeNode for LogicalPlan { fn children_nodes(&self) -> Vec { - self.inputs().into_iter().map(|p| p.clone()).collect() + self.inputs().into_iter().cloned().collect() } fn apply(&self, op: &mut F) -> Result diff --git a/datafusion/physical-expr/src/sort_properties.rs b/datafusion/physical-expr/src/sort_properties.rs index 7b003f320846..b30e32017af4 100644 --- a/datafusion/physical-expr/src/sort_properties.rs +++ b/datafusion/physical-expr/src/sort_properties.rs @@ -174,7 +174,7 @@ impl ExprOrdering { impl TreeNode for ExprOrdering { fn children_nodes(&self) -> Vec { - self.children.iter().map(|c| c.clone()).collect() + self.children.to_vec() } fn map_children(mut self, transform: F) -> Result diff --git a/datafusion/physical-expr/src/utils/mod.rs b/datafusion/physical-expr/src/utils/mod.rs index 35a1cec7c49e..eacba29cbd76 100644 --- a/datafusion/physical-expr/src/utils/mod.rs +++ b/datafusion/physical-expr/src/utils/mod.rs @@ -155,7 +155,7 @@ impl ExprTreeNode { impl TreeNode for ExprTreeNode { fn children_nodes(&self) -> Vec { - self.children().iter().map(|c| c.clone()).collect() + self.children().to_vec() } fn map_children(mut self, transform: F) -> Result