Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Dec 29, 2023
1 parent e05123a commit 56c3919
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ impl DistributionContext {

impl TreeNode for DistributionContext {
fn children_nodes(&self) -> Vec<Self> {
self.children_nodes.iter().map(|c| c.clone()).collect()
self.children_nodes.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down Expand Up @@ -1474,7 +1474,7 @@ impl PlanWithKeyRequirements {

impl TreeNode for PlanWithKeyRequirements {
fn children_nodes(&self) -> Vec<Self> {
self.children.iter().map(|c| c.clone()).collect()
self.children.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/src/physical_optimizer/enforce_sorting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl PlanWithCorrespondingSort {

impl TreeNode for PlanWithCorrespondingSort {
fn children_nodes(&self) -> Vec<Self> {
self.children_nodes.iter().map(|c| c.clone()).collect()
self.children_nodes.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down Expand Up @@ -227,7 +227,7 @@ impl PlanWithCorrespondingCoalescePartitions {

impl TreeNode for PlanWithCorrespondingCoalescePartitions {
fn children_nodes(&self) -> Vec<Self> {
self.children_nodes.iter().map(|c| c.clone()).collect()
self.children_nodes.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/physical_optimizer/pipeline_checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl PipelineStatePropagator {

impl TreeNode for PipelineStatePropagator {
fn children_nodes(&self) -> Vec<Self> {
self.children.iter().map(|c| c.clone()).collect()
self.children.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl OrderPreservationContext {

impl TreeNode for OrderPreservationContext {
fn children_nodes(&self) -> Vec<Self> {
self.children_nodes.iter().map(|c| c.clone()).collect()
self.children_nodes.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/physical_optimizer/sort_pushdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl SortPushDown {

impl TreeNode for SortPushDown {
fn children_nodes(&self) -> Vec<Self> {
self.children_nodes.iter().map(|c| c.clone()).collect()
self.children_nodes.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/src/tree_node/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use datafusion_common::{tree_node::TreeNode, Result};

impl TreeNode for LogicalPlan {
fn children_nodes(&self) -> Vec<Self> {
self.inputs().into_iter().map(|p| p.clone()).collect()
self.inputs().into_iter().cloned().collect()
}

fn apply<F>(&self, op: &mut F) -> Result<VisitRecursion>
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-expr/src/sort_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl ExprOrdering {

impl TreeNode for ExprOrdering {
fn children_nodes(&self) -> Vec<Self> {
self.children.iter().map(|c| c.clone()).collect()
self.children.to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-expr/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl<T> ExprTreeNode<T> {

impl<T: Clone> TreeNode for ExprTreeNode<T> {
fn children_nodes(&self) -> Vec<Self> {
self.children().iter().map(|c| c.clone()).collect()
self.children().to_vec()
}

fn map_children<F>(mut self, transform: F) -> Result<Self>
Expand Down

0 comments on commit 56c3919

Please sign in to comment.