Moved get_component(_unchecked_mut) from Query to QueryState#9686
Moved get_component(_unchecked_mut) from Query to QueryState#9686alice-i-cecile merged 18 commits intobevyengine:mainfrom
get_component(_unchecked_mut) from Query to QueryState#9686Conversation
Also had to move `QueryComponentError` to match the new location of its methods. Also performed a QA pass to narrow the scope of `unsafe` blocks within `Query` methods.
|
Does it makes sense to move |
It might do, I started with
Additionally, neither
If we also migrate the above to |
|
I missed that merge from my branch, apologies! Below would be the complete list of candidates to migrate over:
I'm going to update my PR with the requested changes from @tguichaoua, then I'll migrate the above over just to demonstrate what that change would look like. |
Added to `QueryState`: * `component` * `component_unchecked_mut` * `many_read_only_manual` * `many_unchecked_manual`
Yes; I much prefer that! Unless there's a very good (and commented) reason not to, these APIs should be mirrors of each other. Due to the fact that every |
Co-authored-by: Tristan Guichaoua <[email protected]>
…evyengine#9686) # Objective - Fixes bevyengine#9683 ## Solution - Moved `get_component` from `Query` to `QueryState`. - Moved `get_component_unchecked_mut` from `Query` to `QueryState`. - Moved `QueryComponentError` from `bevy_ecs::system` to `bevy_ecs::query`. Minor Breaking Change. - Narrowed scope of `unsafe` blocks in `Query` methods. --- ## Migration Guide - `use bevy_ecs::system::QueryComponentError;` -> `use bevy_ecs::query::QueryComponentError;` ## Notes I am not very familiar with unsafe Rust nor its use within Bevy, so I may have committed a Rust faux pas during the migration. --------- Co-authored-by: Zac Harrold <[email protected]> Co-authored-by: Tristan Guichaoua <[email protected]>
Objective
QueryState::(get_)component(_mut)#9683Solution
get_componentfromQuerytoQueryState.get_component_unchecked_mutfromQuerytoQueryState.QueryComponentErrorfrombevy_ecs::systemtobevy_ecs::query. Minor Breaking Change.unsafeblocks inQuerymethods.Migration Guide
use bevy_ecs::system::QueryComponentError;->use bevy_ecs::query::QueryComponentError;Notes
I am not very familiar with unsafe Rust nor its use within Bevy, so I may have committed a Rust faux pas during the migration.