File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -903,7 +903,7 @@ impl<T: DynTreeNode + ?Sized> TreeNode for Arc<T> {
903
903
/// involving payloads, by enforcing rules for detaching and reattaching child nodes.
904
904
pub trait ConcreteTreeNode : Sized {
905
905
/// Provides read-only access to child nodes.
906
- fn children ( & self ) -> Vec < & Self > ;
906
+ fn children ( & self ) -> & [ Self ] ;
907
907
908
908
/// Detaches the node from its children, returning the node itself and its detached children.
909
909
fn take_children ( self ) -> ( Self , Vec < Self > ) ;
@@ -917,7 +917,7 @@ impl<T: ConcreteTreeNode> TreeNode for T {
917
917
& self ,
918
918
f : F ,
919
919
) -> Result < TreeNodeRecursion > {
920
- self . children ( ) . into_iter ( ) . apply_until_stop ( f)
920
+ self . children ( ) . iter ( ) . apply_until_stop ( f)
921
921
}
922
922
923
923
fn map_children < F : FnMut ( Self ) -> Result < Transformed < Self > > > (
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ impl<T: Display> Display for ExprContext<T> {
84
84
}
85
85
86
86
impl < T > ConcreteTreeNode for ExprContext < T > {
87
- fn children ( & self ) -> Vec < & Self > {
88
- self . children . iter ( ) . collect ( )
87
+ fn children ( & self ) -> & [ Self ] {
88
+ & self . children
89
89
}
90
90
91
91
fn take_children ( mut self ) -> ( Self , Vec < Self > ) {
Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ impl<T: Display> Display for PlanContext<T> {
86
86
}
87
87
88
88
impl < T > ConcreteTreeNode for PlanContext < T > {
89
- fn children ( & self ) -> Vec < & Self > {
90
- self . children . iter ( ) . collect ( )
89
+ fn children ( & self ) -> & [ Self ] {
90
+ & self . children
91
91
}
92
92
93
93
fn take_children ( mut self ) -> ( Self , Vec < Self > ) {
You can’t perform that action at this time.
0 commit comments