File tree 2 files changed +8
-8
lines changed
crates/bevy_hierarchy/src
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -414,7 +414,7 @@ impl<'w> BuildWorldChildren for EntityMut<'w> {
414
414
. retain ( |value| !children. contains ( value) ) ;
415
415
children_component. 0 . extend ( children. iter ( ) . cloned ( ) ) ;
416
416
} else {
417
- self . insert ( Children :: with ( children) ) ;
417
+ self . insert ( Children :: from_entities ( children) ) ;
418
418
}
419
419
self
420
420
}
@@ -435,7 +435,7 @@ impl<'w> BuildWorldChildren for EntityMut<'w> {
435
435
. retain ( |value| !children. contains ( value) ) ;
436
436
children_component. 0 . insert_from_slice ( index, children) ;
437
437
} else {
438
- self . insert ( Children :: with ( children) ) ;
438
+ self . insert ( Children :: from_entities ( children) ) ;
439
439
}
440
440
self
441
441
}
@@ -479,7 +479,7 @@ impl<'w> BuildWorldChildren for WorldChildBuilder<'w> {
479
479
} else {
480
480
self . world
481
481
. entity_mut ( parent)
482
- . insert ( Children :: with ( children) ) ;
482
+ . insert ( Children :: from_entities ( children) ) ;
483
483
}
484
484
self
485
485
}
@@ -497,7 +497,7 @@ impl<'w> BuildWorldChildren for WorldChildBuilder<'w> {
497
497
} else {
498
498
self . world
499
499
. entity_mut ( parent)
500
- . insert ( Children :: with ( children) ) ;
500
+ . insert ( Children :: from_entities ( children) ) ;
501
501
}
502
502
self
503
503
}
Original file line number Diff line number Diff line change @@ -36,12 +36,12 @@ impl FromWorld for Children {
36
36
}
37
37
38
38
impl Children {
39
- /// Builds and returns a [`Children`] component with the given entities
40
- pub fn with ( entity : & [ Entity ] ) -> Self {
41
- Self ( SmallVec :: from_slice ( entity ) )
39
+ /// Constructs a [`Children`] component with the given entities.
40
+ pub ( crate ) fn from_entities ( entities : & [ Entity ] ) -> Self {
41
+ Self ( SmallVec :: from_slice ( entities ) )
42
42
}
43
43
44
- /// Swaps the child at `a_index` with the child at `b_index`
44
+ /// Swaps the child at `a_index` with the child at `b_index`.
45
45
pub fn swap ( & mut self , a_index : usize , b_index : usize ) {
46
46
self . 0 . swap ( a_index, b_index) ;
47
47
}
You can’t perform that action at this time.
0 commit comments