Skip to content

Option<I> SystemInput#23712

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
ItsDoot:ecs/option-input
Apr 12, 2026
Merged

Option<I> SystemInput#23712
alice-i-cecile merged 1 commit intobevyengine:mainfrom
ItsDoot:ecs/option-input

Conversation

@ItsDoot
Copy link
Copy Markdown
Contributor

@ItsDoot ItsDoot commented Apr 8, 2026

Objective

  • Provide more standard system input types/combinators.

Currently, if users want a system to take Option<&mut T> or Option<&T> as system input, they need to either use InMut<Option<T>>/InRef<Option<T>> which actually result in a &mut Option<T>/&Option<T>, or create their own SystemInput type.

Solution

Implement SystemInput for Option<I> where I can be any SystemInput type.

Testing

Added a test for this.

@ItsDoot ItsDoot added D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 8, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in ECS Apr 8, 2026
@ItsDoot ItsDoot added D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes and removed D-Trivial Nice and easy! A great choice to get started with Bevy labels Apr 8, 2026
@ItsDoot ItsDoot 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-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 8, 2026
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

I'd prefer World::run_system_once in tests, but that's just a style nit :)

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 12, 2026
Merged via the queue into bevyengine:main with commit 4bf5612 Apr 12, 2026
51 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in ECS Apr 12, 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-Usability A targeted quality-of-life change that makes Bevy easier to use D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants