From 955c79f29908b5b25c49050b40f76f491b14ff2d Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Fri, 23 Jul 2021 17:06:52 -0700 Subject: [PATCH] adapt to upstream changes --- crates/bevy_app/src/app.rs | 10 +++------- crates/bevy_ecs/src/system/commands/mod.rs | 2 +- crates/bevy_ecs/src/system/system_param.rs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index c7a400ad34185..f27f60699ff16 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -3,7 +3,7 @@ use bevy_ecs::{ component::{Component, ComponentDescriptor}, prelude::{FromWorld, IntoExclusiveSystem, IntoSystem}, schedule::{ - RunOnce, Schedule, Stage, StageLabel, State, SystemDescriptor, SystemSet, SystemStage, + IntoSystemDescriptor, RunOnce, Schedule, Stage, StageLabel, State, SystemSet, SystemStage, }, world::World, }; @@ -12,8 +12,6 @@ use std::{fmt::Debug, hash::Hash}; #[cfg(feature = "trace")] use bevy_utils::tracing::info_span; -use std::fmt::Debug; -use std::hash::Hash; #[allow(clippy::needless_doctest_main)] /// Containers of app logic and data @@ -278,8 +276,7 @@ impl App { stage_label: impl StageLabel, system: impl IntoSystemDescriptor, ) -> &mut Self { - self.app - .schedule + self.schedule .stage(CoreStage::Startup, |schedule: &mut Schedule| { schedule.add_system_to_stage(stage_label, system) }); @@ -291,8 +288,7 @@ impl App { stage_label: impl StageLabel, system_set: SystemSet, ) -> &mut Self { - self.app - .schedule + self.schedule .stage(CoreStage::Startup, |schedule: &mut Schedule| { schedule.add_system_set_to_stage(stage_label, system_set) }); diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index 6d5e6a12a883d..fe6addbd65b98 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -291,7 +291,7 @@ pub struct GetOrSpawn { } impl Command for GetOrSpawn { - fn write(self: Box, world: &mut World) { + fn write(self, world: &mut World) { world.get_or_spawn(self.entity); } } diff --git a/crates/bevy_ecs/src/system/system_param.rs b/crates/bevy_ecs/src/system/system_param.rs index b56cda59cfcb7..6194b0f3dcc58 100644 --- a/crates/bevy_ecs/src/system/system_param.rs +++ b/crates/bevy_ecs/src/system/system_param.rs @@ -825,14 +825,14 @@ unsafe impl SystemParamState for OptionNonSendState { fn default_config() {} } -impl<'a, T: 'static> SystemParamFetch<'a> for OptionNonSendState { - type Item = Option>; +impl<'s, 'w, T: 'static> SystemParamFetch<'s, 'w> for OptionNonSendState { + type Item = Option>; #[inline] unsafe fn get_param( - state: &'a mut Self, + state: &'s mut Self, system_meta: &SystemMeta, - world: &'a World, + world: &'w World, change_tick: u32, ) -> Self::Item { world.validate_non_send_access::(); @@ -942,14 +942,14 @@ unsafe impl SystemParamState for OptionNonSendMutState { fn default_config() {} } -impl<'a, T: 'static> SystemParamFetch<'a> for OptionNonSendMutState { - type Item = Option>; +impl<'s, 'w, T: 'static> SystemParamFetch<'s, 'w> for OptionNonSendMutState { + type Item = Option>; #[inline] unsafe fn get_param( - state: &'a mut Self, + state: &'s mut Self, system_meta: &SystemMeta, - world: &'a World, + world: &'w World, change_tick: u32, ) -> Self::Item { world.validate_non_send_access::();