Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Guvante committed Aug 13, 2021
1 parent 062edac commit d7845da
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion crates/bevy_ecs/src/query/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ use std::{
pub trait WorldQuery {
type Fetch: for<'world, 'state> Fetch<'world, 'state, State = Self::State>;
type State: FetchState;
type ReadOnlyFetch: for<'world, 'state> Fetch<'world, 'state, State = Self::State> + ReadOnlyFetch;
type ReadOnlyFetch: for<'world, 'state> Fetch<'world, 'state, State = Self::State>
+ ReadOnlyFetch;
}

pub trait Fetch<'world, 'state>: Sized {
Expand Down
8 changes: 7 additions & 1 deletion crates/bevy_ecs/src/query/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,13 @@ where
}
}

struct QueryIterationCursor<'w, 's, Q: WorldQuery, QF: Fetch<'w, 's, State = Q::State>, F: WorldQuery> {
struct QueryIterationCursor<
'w,
's,
Q: WorldQuery,
QF: Fetch<'w, 's, State = Q::State>,
F: WorldQuery,
> {
table_id_iter: std::slice::Iter<'s, TableId>,
archetype_id_iter: std::slice::Iter<'s, ArchetypeId>,
fetch: QF,
Expand Down
12 changes: 10 additions & 2 deletions crates/bevy_ecs/src/query/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,11 @@ where
}

#[inline]
pub fn par_for_each<'w, 's, FN: Fn(<Q::ReadOnlyFetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone>(
pub fn par_for_each<
'w,
's,
FN: Fn(<Q::ReadOnlyFetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
>(
&'s mut self,
world: &'w World,
task_pool: &TaskPool,
Expand All @@ -394,7 +398,11 @@ where
}

#[inline]
pub fn par_for_each_mut<'w, 's, FN: Fn(<Q::Fetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone>(
pub fn par_for_each_mut<
'w,
's,
FN: Fn(<Q::Fetch as Fetch<'w, 's>>::Item) + Send + Sync + Clone,
>(
&'s mut self,
world: &'w mut World,
task_pool: &TaskPool,
Expand Down
4 changes: 3 additions & 1 deletion crates/bevy_ecs/src/system/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ where
/// ```
///
/// This can only return immutable data, see [`Self::single_mut`] for mutable access.
pub fn single<'s>(&'s self) -> Result<<Q::ReadOnlyFetch as Fetch<'w, 's>>::Item, QuerySingleError> {
pub fn single<'s>(
&'s self,
) -> Result<<Q::ReadOnlyFetch as Fetch<'w, 's>>::Item, QuerySingleError> {
let mut query = self.iter();
let first = query.next();
let extra = query.next().is_some();
Expand Down

0 comments on commit d7845da

Please sign in to comment.