Add link to with_children in with_child doc (#14604)

# Objective

Discourage users from using `with_child` for spawning multiple children.

## Solution

Add link to `with_children` in docs for `with_child`.
This commit is contained in:
Rob Parrett 2024-08-04 06:36:52 -07:00 committed by GitHub
parent 9b254aab1e
commit e164e5a873
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -339,9 +339,17 @@ pub trait BuildChildren {
type Builder<'a>: ChildBuild;
/// Takes a closure which builds children for this entity using [`ChildBuild`].
///
/// For convenient spawning of a single child, you can use [`with_child`].
///
/// [`with_child`]: BuildChildren::with_child
fn with_children(&mut self, f: impl FnOnce(&mut Self::Builder<'_>)) -> &mut Self;
/// Spawns the passed bundle and adds it to this entity as a child.
///
/// For efficient spawning of multiple children, use [`with_children`].
///
/// [`with_children`]: BuildChildren::with_children
fn with_child<B: Bundle>(&mut self, bundle: B) -> &mut Self;
/// Pushes children to the back of the builder's children. For any entities that are