From ec4a496800c929b9e76b07666473bb7c843da189 Mon Sep 17 00:00:00 2001 From: Louis Capitanchik <contact@louiscap.co> Date: Sun, 23 Apr 2023 16:49:26 +0100 Subject: [PATCH] Update system param lifetimes --- src/camera.rs | 2 +- src/map_query.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index cb1b96d..7aa1a39 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -31,7 +31,7 @@ pub fn lock_camera_to_level<CameraSelector: ReadOnlyWorldQuery>( #[derive(SystemParam)] pub struct CameraBounder<'w, 's, Filter: ReadOnlyWorldQuery + 'static> { - map_query: MapQuery<'w, 's>, + map_query: MapQuery<'w>, query: Query<'w, 's, &'static OrthographicProjection, Filter>, } impl<'w, 's, Filter: ReadOnlyWorldQuery + 'static> CameraBounder<'w, 's, Filter> { diff --git a/src/map_query.rs b/src/map_query.rs index 9c0f3d5..4554d4b 100644 --- a/src/map_query.rs +++ b/src/map_query.rs @@ -11,11 +11,9 @@ use crate::system::ActiveLevel; use crate::{LdtkLayer, LdtkLevel}; #[derive(SystemParam)] -pub struct MapQuery<'w, 's> { +pub struct MapQuery<'w> { active: Option<Res<'w, ActiveLevel>>, index: Res<'w, LevelIndex>, - #[system_param(ignore)] - _e: PhantomData<&'s ()>, } pub struct InstanceRef<'a> { @@ -81,7 +79,7 @@ impl CameraBounds { } } -impl<'w, 's> MapQuery<'w, 's> { +impl<'w> MapQuery<'w> { // --- We put our logic in static accessors because we might source a level other // --- than the currently active one. 'active' methods are a convenience to // --- call the static accessors on whatever the current level is -- GitLab