Skip to content

Commit e912cc0

Browse files
committed
fix impls
1 parent 4d15f2c commit e912cc0

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

crates/bevy_render/src/extract_param.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use bevy_ecs::{
44
prelude::*,
55
query::FilteredAccessSet,
66
system::{
7-
ReadOnlySystemParam, SystemMeta, SystemParam, SystemParamItem, SystemParamValidationError,
8-
SystemState,
7+
ReadOnlySystemParam, ReborrowSystemParam, SystemMeta, SystemParam, SystemParamItem,
8+
SystemParamValidationError, SystemState,
99
},
1010
world::unsafe_world_cell::UnsafeWorldCell,
1111
};
@@ -72,14 +72,6 @@ where
7272
type State = ExtractState<P>;
7373
type Item<'w, 's> = Extract<'w, 's, P>;
7474

75-
fn reborrow<'wlong: 'short, 'slong: 'short, 'short>(
76-
item: &'short mut Self::Item<'wlong, 'slong>,
77-
) -> Self::Item<'short, 'short> {
78-
Extract {
79-
item: <P as SystemParam>::reborrow(&mut item.item),
80-
}
81-
}
82-
8375
fn init_state(world: &mut World) -> Self::State {
8476
let mut main_world = world.resource_mut::<MainWorld>();
8577
ExtractState {
@@ -149,10 +141,20 @@ where
149141
}
150142
}
151143

152-
impl<'w, 's, P: ReadOnlySystemParam> Extract<'w, 's, P> {
144+
impl<P: ReborrowSystemParam + ReadOnlySystemParam> ReborrowSystemParam for Extract<'_, '_, P> {
145+
fn reborrow<'wlong: 'short, 'slong: 'short, 'short>(
146+
item: &'short mut Self::Item<'wlong, 'slong>,
147+
) -> Self::Item<'short, 'short> {
148+
Extract {
149+
item: P::reborrow(&mut item.item),
150+
}
151+
}
152+
}
153+
154+
impl<'w, 's, P: ReborrowSystemParam + ReadOnlySystemParam> Extract<'w, 's, P> {
153155
pub fn reborrow(&mut self) -> Extract<'_, '_, P> {
154156
Extract {
155-
item: <P as SystemParam>::reborrow(&mut self.item),
157+
item: P::reborrow(&mut self.item),
156158
}
157159
}
158160
}

0 commit comments

Comments
 (0)