Add an `iter_empty` for `RelationshipTarget`.
Open
A-ECS
C-Usability
D-Straightforward
S-Ready-For-Implementation
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
Due to bevy's conventions, `Children` and similar components may not exist, and code should generally not treat them as required to exist. Therefore it is nice to be able to return an empty iterator when `Children` is missing.
## What solution would you like?
Add a `RelationshipTarget::iter_empty() -> Self::Collection::SourceIter` method.
This is supported by all `std` collections as all of them have a `Default` implementation for their iterators.
## What alternative(s) have you considered?
Don't add this method, since this might not be an universal trait for all iterators.
Contributor guide
Assessment
This issue has not been assessed yet.