insert_if_new
does not have a non-panicking variant
#14771
Labels
A-ECS
Entities, components, systems, and events
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
D-Trivial
Nice and easy! A great choice to get started with Bevy
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
X-Uncontroversial
This work is generally agreed upon
What problem does this solve or what need does it fill?
#14646 added the
insert_if_new
command. However, it did not addtry_insert_if_new
, which is inconsistent and inconvenient. The docs simply linktry_insert
as the non-panicking variant, even though it is functionally different, as it replaces instead of keeping existing components.bevy/crates/bevy_ecs/src/system/commands/mod.rs
Lines 952 to 967 in 5243fe6
What solution would you like?
Add
try_insert_if_new
.The text was updated successfully, but these errors were encountered: