Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datafusion/common/src/tree_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ impl<T: DynTreeNode + ?Sized> TreeNode for Arc<T> {
/// involving payloads, by enforcing rules for detaching and reattaching child nodes.
pub trait ConcreteTreeNode: Sized {
/// Provides read-only access to child nodes.
fn children(&self) -> Vec<&Self>;
fn children(&self) -> &[Self];

/// Detaches the node from its children, returning the node itself and its detached children.
fn take_children(self) -> (Self, Vec<Self>);
Expand All @@ -917,7 +917,7 @@ impl<T: ConcreteTreeNode> TreeNode for T {
&self,
f: F,
) -> Result<TreeNodeRecursion> {
self.children().into_iter().apply_until_stop(f)
self.children().iter().apply_until_stop(f)
}

fn map_children<F: FnMut(Self) -> Result<Transformed<Self>>>(
Expand Down
4 changes: 2 additions & 2 deletions datafusion/physical-expr-common/src/tree_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ impl<T: Display> Display for ExprContext<T> {
}

impl<T> ConcreteTreeNode for ExprContext<T> {
fn children(&self) -> Vec<&Self> {
self.children.iter().collect()
fn children(&self) -> &[Self] {
&self.children
}

fn take_children(mut self) -> (Self, Vec<Self>) {
Expand Down
4 changes: 2 additions & 2 deletions datafusion/physical-plan/src/tree_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ impl<T: Display> Display for PlanContext<T> {
}

impl<T> ConcreteTreeNode for PlanContext<T> {
fn children(&self) -> Vec<&Self> {
self.children.iter().collect()
fn children(&self) -> &[Self] {
&self.children
}

fn take_children(mut self) -> (Self, Vec<Self>) {
Expand Down