-
-
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
[Merged by Bors] - Add QueryState::get_single_unchecked_manual and its family #4841
Conversation
Fix formatting
This is ready to merge once the lifetimes are fixed. |
Going to get one final review from the lifetime crew to verify. |
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.
lifetimes seem reasonable to me, didnt really look at anything other than that
@@ -258,7 +258,7 @@ struct QueryIterationCursor<'w, 's, Q: WorldQuery, QF: Fetch<'w, State = Q::Stat | |||
filter: QueryFetch<'w, F>, | |||
current_len: usize, | |||
current_index: usize, | |||
phantom: PhantomData<&'w Q>, | |||
phantom: PhantomData<(&'w (), Q)>, |
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 change shouldn't be needed; what happens if you remove it?
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.
@alice-i-cecile Compilation error that I mentioned in Discord. @BoxyUwU suggested this fix for it.
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.
for future context &'w Q
requires Q: 'w
to hold which is unnecessary, this change makes that not required
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.
bors r+
# 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 <[email protected]> Co-authored-by: 2ne1ugly <[email protected]>
…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 <[email protected]> Co-authored-by: 2ne1ugly <[email protected]>
…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 <[email protected]> Co-authored-by: 2ne1ugly <[email protected]>
Objective
QueryState::get_single_unchecked_manual
and its family #3159.Solution
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 thestate
module.Migration Guide
Change
query::QuerySingleError
tostate::QuerySingleError