Skip to content

Commit

Permalink
Update crates/bevy_render/src/render_ecs_resource.rs
Browse files Browse the repository at this point in the history
Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com>
  • Loading branch information
superdump and MinerSebas committed Mar 3, 2022
1 parent f3095d5 commit dc90e02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/bevy_render/src/render_ecs_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ pub trait ExtractResource: Resource {
///
/// Therefore it sets up the [`RenderStage::Extract`](crate::RenderStage::Extract) step
/// for the specified [`Resource`].
pub struct ExtractResourcePlugin<R: ExtractResource + Resource>(PhantomData<R>);
pub struct ExtractResourcePlugin<R: ExtractResource>(PhantomData<R>);

impl<R: ExtractResource + Resource> Default for ExtractResourcePlugin<R> {
impl<R: ExtractResource> Default for ExtractResourcePlugin<R> {
fn default() -> Self {
Self(PhantomData)
}
}

impl<R: ExtractResource + Resource> Plugin for ExtractResourcePlugin<R> {
impl<R: ExtractResource> Plugin for ExtractResourcePlugin<R> {
fn build(&self, app: &mut App) {
let system = ExtractResourceSystem::<R>::system(&mut app.world);
if let Ok(render_app) = app.get_sub_app_mut(RenderApp) {
Expand All @@ -41,9 +41,9 @@ impl<R: ExtractResource + Resource> Plugin for ExtractResourcePlugin<R> {

/// This system extracts the resource of the corresponding [`Resource`] type
/// by cloning it.
pub struct ExtractResourceSystem<R: ExtractResource + Resource>(PhantomData<R>);
pub struct ExtractResourceSystem<R: ExtractResource>(PhantomData<R>);

impl<R: ExtractResource + Resource> RunSystem for ExtractResourceSystem<R> {
impl<R: ExtractResource> RunSystem for ExtractResourceSystem<R> {
type Param = (SCommands, SRes<R>);

fn run((mut commands, res): SystemParamItem<Self::Param>) {
Expand Down

0 comments on commit dc90e02

Please sign in to comment.