Skip to content

Add EntityCommands::insert_if_neq#23944

Merged
alice-i-cecile merged 5 commits intobevyengine:mainfrom
micttyoid:insert-if-not-eq
Apr 23, 2026
Merged

Add EntityCommands::insert_if_neq#23944
alice-i-cecile merged 5 commits intobevyengine:mainfrom
micttyoid:insert-if-not-eq

Conversation

@micttyoid
Copy link
Copy Markdown
Contributor

Comment thread crates/bevy_ecs/src/system/commands/entity_command.rs Outdated
@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-ECS Entities, components, systems, and events D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 22, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in ECS Apr 22, 2026
Comment thread crates/bevy_ecs/src/system/commands/entity_command.rs Outdated
@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 23, 2026
micttyoid and others added 2 commits April 23, 2026 19:32
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Comment thread crates/bevy_ecs/src/system/commands/mod.rs Outdated
@alice-i-cecile alice-i-cecile requested a review from kfc35 April 23, 2026 20:22
@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Apr 23, 2026
Comment thread crates/bevy_ecs/src/system/commands/mod.rs Outdated

/// Adds a [`Component`] to the entity if the component is different or
/// missing.
#[track_caller]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the closure will lose the #[track_caller]. If we want to thread the caller through, we may have to go back to insert_with_caller so that we can call MaybeLocation::caller() outside of the closure and then pass it through explicitly.

Copy link
Copy Markdown
Contributor Author

@micttyoid micttyoid Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com>
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 23, 2026
Merged via the queue into bevyengine:main with commit 1841fa0 Apr 23, 2026
38 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in ECS Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add EntityCommands::insert_if_neq

4 participants