Skip to content

Commit

Permalink
Remove redundant static lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Aug 1, 2024
1 parent e87fe9a commit 6591461
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/core/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ struct CameraConfig {
}

impl Config for CameraConfig {
const PATH: &'static str = "config/camera.ron";
const EXTENSION: &'static str = "camera.ron";
const PATH: &str = "config/camera.ron";
const EXTENSION: &str = "camera.ron";

fn on_load(&mut self, world: &mut World) {
let (mut projection, mut follow) = r!(world
Expand Down
4 changes: 2 additions & 2 deletions src/core/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub struct ThemeConfig {
}

impl Config for ThemeConfig {
const PATH: &'static str = "config/theme.ron";
const EXTENSION: &'static str = "theme.ron";
const PATH: &str = "config/theme.ron";
const EXTENSION: &str = "theme.ron";

fn on_load(&mut self, world: &mut World) {
world.resource_mut::<ClearColor>().0 = self.colors[ThemeColor::Body];
Expand Down
4 changes: 2 additions & 2 deletions src/core/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub struct WindowConfig {
}

impl Config for WindowConfig {
const PATH: &'static str = "config/window.ron";
const EXTENSION: &'static str = "window.ron";
const PATH: &str = "config/window.ron";
const EXTENSION: &str = "window.ron";

fn on_load(&mut self, world: &mut World) {
world
Expand Down
4 changes: 2 additions & 2 deletions src/game/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ pub struct ActorConfig {
}

impl Config for ActorConfig {
const PATH: &'static str = "config/actor.ron";
const EXTENSION: &'static str = "actor.ron";
const PATH: &str = "config/actor.ron";
const EXTENSION: &str = "actor.ron";

fn on_load(&mut self, world: &mut World) {
let mut system_state =
Expand Down
4 changes: 2 additions & 2 deletions src/game/actor/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pub struct HealthConfig {
}

impl Config for HealthConfig {
const PATH: &'static str = "config/health.ron";
const EXTENSION: &'static str = "health.ron";
const PATH: &str = "config/health.ron";
const EXTENSION: &str = "health.ron";
}

impl HealthConfig {
Expand Down
4 changes: 2 additions & 2 deletions src/game/actor/level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub struct LevelConfig {
}

impl Config for LevelConfig {
const PATH: &'static str = "config/level.ron";
const EXTENSION: &'static str = "level.ron";
const PATH: &str = "config/level.ron";
const EXTENSION: &str = "level.ron";
}

impl LevelConfig {
Expand Down
4 changes: 2 additions & 2 deletions src/game/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pub struct AudioConfig {
}

impl Config for AudioConfig {
const PATH: &'static str = "config/audio.ron";
const EXTENSION: &'static str = "audio.ron";
const PATH: &str = "config/audio.ron";
const EXTENSION: &str = "audio.ron";

fn on_load(&mut self, world: &mut World) {
world.resource::<Audio>().set_volume(self.global_volume);
Expand Down
4 changes: 2 additions & 2 deletions src/game/card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub struct CardConfig {
}

impl Config for CardConfig {
const PATH: &'static str = "config/card.ron";
const EXTENSION: &'static str = "card.ron";
const PATH: &str = "config/card.ron";
const EXTENSION: &str = "card.ron";

fn on_load(&mut self, world: &mut World) {
let (asset_server, card_action_map, mut layouts) = SystemState::<(
Expand Down
4 changes: 2 additions & 2 deletions src/game/combat/projectile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub struct ProjectileConfig {
}

impl Config for ProjectileConfig {
const PATH: &'static str = "config/projectile.ron";
const EXTENSION: &'static str = "projectile.ron";
const PATH: &str = "config/projectile.ron";
const EXTENSION: &str = "projectile.ron";

fn on_load(&mut self, world: &mut World) {
let asset_server = world.resource::<AssetServer>();
Expand Down
4 changes: 2 additions & 2 deletions src/game/spotlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ pub struct SpotlightConfig {
}

impl Config for SpotlightConfig {
const PATH: &'static str = "config/spotlight.ron";
const EXTENSION: &'static str = "spotlight.ron";
const PATH: &str = "config/spotlight.ron";
const EXTENSION: &str = "spotlight.ron";

fn on_load(&mut self, _world: &mut World) {
for color in &mut self.color_loop {
Expand Down
4 changes: 2 additions & 2 deletions src/game/wave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pub struct WaveConfig {
}

impl Config for WaveConfig {
const PATH: &'static str = "config/wave.ron";
const EXTENSION: &'static str = "wave.ron";
const PATH: &str = "config/wave.ron";
const EXTENSION: &str = "wave.ron";
}

#[allow(unused)]
Expand Down
4 changes: 2 additions & 2 deletions src/util/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use serde::Serialize;
use crate::util::prelude::*;

pub trait Config: Asset + Serialize + for<'de> Deserialize<'de> {
const PATH: &'static str;
const EXTENSION: &'static str;
const PATH: &str;
const EXTENSION: &str;

fn on_load(&mut self, world: &mut World) {
let _ = world;
Expand Down

0 comments on commit 6591461

Please sign in to comment.