diff --git a/datafusion/core/src/physical_optimizer/enforce_distribution.rs b/datafusion/core/src/physical_optimizer/enforce_distribution.rs index 6f35a97fac24d..5ec99c0b42d8b 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.iter().cloned().collect() } 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.iter().cloned().collect() } 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 52b59969139a2..c16302df2362c 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.iter().cloned().collect() } 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.iter().cloned().collect() } 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 01664e4bbd186..52367d88593ff 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.iter().cloned().collect() } 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 ae946195c043b..20eb06575faed 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.iter().cloned().collect() } 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 441abec040f1f..1154ac57be031 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.iter().cloned().collect() } fn map_children(mut self, transform: F) -> Result