bevyengine / bevyengine/bevy

ChildBuilder methods should take IntoIterator, rather than a slice type

Open
#7,229 7 comments 0 reactions 0 assignees View on GitHub
C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

It's generally better to use an iterator type instead of forcing someone to use a `slice`. Since it's not always guaranteed that the children entities will be in an array-like container.

```suggestion
fn replace_children(&mut self, children: impl IntoIterator) -> &mut Self {
```

_Originally posted by @NathanSWard in https://github.com/bevyengine/bevy/pull/6035#discussion_r981546329_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.