-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add QueryState::get_single_unchecked_manual
and its family
#3159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome first PR, thank you! I have not a single nit to pick.
Other than the broken import that CI caught of course :p You should check out https://github.com/bevyengine/bevy/blob/main/CONTRIBUTING.md if you haven't yet, and welcome aboard :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR needs to be updated due to the changes from #2305
@2ne1ugly could you rebase the PR ? |
Done |
Thanks! Cart said that he will back to this in about a week. |
I just double-checked, and the lifetimes here appear to be correct: compare to bevy/crates/bevy_ecs/src/query/state.rs Line 139 in d9d2fb6
|
Sorry for being a bit late! I'm doing unversity on weekends and it's the mid-term season. |
@Shatur @MinerSebas can I get another review on this? |
bors try |
tryBuild failed: |
@2ne1ugly can you please rebase? I think the CI failure is spurious based on an old breakage we had. |
Currently broken; the lifetimes must be fixed. Once this compiles again, I'm happy to slap the |
I'm on vacation rn so I won't be able to help until june 6th. If we need this earlier, feel free to do it for me :) |
No problem, fixed it: #4841. |
# Objective - Rebase of #3159. - Fixes #3156 - add #[inline] to single related functions so that they matches with other function defs ## Solution * added functions to QueryState * get_single_unchecked_manual * get_single_unchecked * get_single * get_single_mut * single * single_mut * make Query::get_single use QueryState::get_single_unchecked_manual * added #[inline] --- ## Changelog ### Added Functions `QueryState::single`, `QueryState::get_single`, `QueryState::single_mut`, `QueryState::get_single_mut`, `QueryState::get_single_unchecked`, `QueryState::get_single_unchecked_manual`. ### Changed `QuerySingleError` is now in the `state` module. ## Migration Guide Change `query::QuerySingleError` to `state::QuerySingleError` Co-authored-by: 2ne1ugly <chattermin@gmail.com> Co-authored-by: 2ne1ugly <47616772+2ne1ugly@users.noreply.github.com>
As #4841 has been merged, closing this one. |
…e#4841) # Objective - Rebase of bevyengine#3159. - Fixes bevyengine#3156 - add #[inline] to single related functions so that they matches with other function defs ## Solution * added functions to QueryState * get_single_unchecked_manual * get_single_unchecked * get_single * get_single_mut * single * single_mut * make Query::get_single use QueryState::get_single_unchecked_manual * added #[inline] --- ## Changelog ### Added Functions `QueryState::single`, `QueryState::get_single`, `QueryState::single_mut`, `QueryState::get_single_mut`, `QueryState::get_single_unchecked`, `QueryState::get_single_unchecked_manual`. ### Changed `QuerySingleError` is now in the `state` module. ## Migration Guide Change `query::QuerySingleError` to `state::QuerySingleError` Co-authored-by: 2ne1ugly <chattermin@gmail.com> Co-authored-by: 2ne1ugly <47616772+2ne1ugly@users.noreply.github.com>
…e#4841) # Objective - Rebase of bevyengine#3159. - Fixes bevyengine#3156 - add #[inline] to single related functions so that they matches with other function defs ## Solution * added functions to QueryState * get_single_unchecked_manual * get_single_unchecked * get_single * get_single_mut * single * single_mut * make Query::get_single use QueryState::get_single_unchecked_manual * added #[inline] --- ## Changelog ### Added Functions `QueryState::single`, `QueryState::get_single`, `QueryState::single_mut`, `QueryState::get_single_mut`, `QueryState::get_single_unchecked`, `QueryState::get_single_unchecked_manual`. ### Changed `QuerySingleError` is now in the `state` module. ## Migration Guide Change `query::QuerySingleError` to `state::QuerySingleError` Co-authored-by: 2ne1ugly <chattermin@gmail.com> Co-authored-by: 2ne1ugly <47616772+2ne1ugly@users.noreply.github.com>
Hey people! This is my first PR to bevy. Definitely this issue helped me get some insights to bevy ecs.
I hope I followed the correct conventions! Tho, don't mind to correct them :)
Objective
#[inline]
tosingle
related functions so that they matches with other function defsQuery::single
,Query::get_single
Solution
QueryState
get_single_unchecked_manual
get_single_unchecked
get_single
get_single_mut
single
single_mut
Query::get_single
useQueryState::get_single_unchecked_manual
#[inline]
& elided lifetimes#[derive(Debug, Error)]
to#[derive(Error, Debug)]
because it tilts me