Conversation
Convenience method wrapping `World::try_run_schedule`
alice-i-cecile
left a comment
There was a problem hiding this comment.
Not just unwrapping I see :P I think this is good default behavior, but we'll need to come back and change this when we tackle command error handling.
I was half tempted to do |
mockersf
left a comment
There was a problem hiding this comment.
I would prefer this to panic until there's a way to react in code to errors
Running a schedule that doesn't exist doesn't seem like something that should be ignored and you would still expect everything working
|
Does |
|
no, you can't react to it in code |
|
Yeah we can swap to panicking for now for consistency and then fix it during command error handling. |
# Objective - Fixes bevyengine#16495 ## Solution - Added `Commands::run_schedule`, which internally calls `World::try_run_schedule`, logging any issues. ## Testing - Added doctest - Ran CI ## Showcase Instead of writing: ```rust commands.queue(|world: &mut World| world.run_schedule(FooSchedule)); ``` You can now write: ```rust commands.run_schedule(FooSchedule); ```
Objective
Commands::run_schedule#16495Solution
Commands::run_schedule, which internally callsWorld::try_run_schedule, panicking on any issues.Testing
Showcase
Instead of writing:
You can now write: