diff --git a/planet/src/lib.rs b/planet/src/lib.rs index 31c0daa..358e2c3 100644 --- a/planet/src/lib.rs +++ b/planet/src/lib.rs @@ -1,37 +1,3 @@ -#![warn(absolute_paths_not_starting_with_crate)] -#![warn(box_pointers)] -#![warn(elided_lifetimes_in_paths)] -#![warn(explicit_outlives_requirements)] -#![warn(keyword_idents)] -#![warn(macro_use_extern_crate)] -#![warn(meta_variable_misuse)] -#![warn(missing_abi)] -// #![warn(missing_copy_implementations)] -#![warn(missing_debug_implementations)] -// #![warn(missing_docs)] -#![warn(non_ascii_idents)] -#![warn(noop_method_call)] -#![warn(pointer_structural_match)] -#![warn(rust_2021_incompatible_closure_captures)] -#![warn(rust_2021_incompatible_or_patterns)] -#![warn(rust_2021_prefixes_incompatible_syntax)] -#![warn(rust_2021_prelude_collisions)] -#![warn(single_use_lifetimes)] -#![warn(trivial_casts)] -#![warn(trivial_numeric_casts)] -#![warn(unreachable_pub)] -#![warn(unsafe_code)] -#![warn(unsafe_op_in_unsafe_fn)] -#![warn(unstable_features)] -#![warn(unused_crate_dependencies)] -#![warn(unused_extern_crates)] -#![warn(unused_import_braces)] -#![warn(unused_lifetimes)] -#![warn(unused_macro_rules)] -#![warn(unused_qualifications)] -#![warn(unused_results)] -#![warn(variant_size_differences)] - pub mod world; pub use world::{TerrainCell, World, WorldGenError}; pub mod biome; diff --git a/planet/src/math_util.rs b/planet/src/math_util.rs index d41c680..a8b2889 100644 --- a/planet/src/math_util.rs +++ b/planet/src/math_util.rs @@ -26,7 +26,7 @@ impl Error for CartesianError { } } impl Display for CartesianError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { CartesianError::InvalidAlpha(alpha) => { f.write_fmt(format_args!("Alpha value must be [0..PI], was {}", alpha)) diff --git a/planet/src/saving.rs b/planet/src/saving.rs index b28cedb..724a709 100644 --- a/planet/src/saving.rs +++ b/planet/src/saving.rs @@ -50,7 +50,7 @@ impl<'de> Deserialize<'de> for World { impl<'de> Visitor<'de> for WorldVisitor { type Value = World; - fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { + fn expecting(&self, formatter: &mut Formatter) -> fmt::Result { formatter.write_str("struct World") } diff --git a/planet/src/world.rs b/planet/src/world.rs index e9a208b..8f06906 100644 --- a/planet/src/world.rs +++ b/planet/src/world.rs @@ -46,7 +46,7 @@ impl Error for WorldGenError { } } impl Display for WorldGenError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { WorldGenError::CartesianError(err) => Display::fmt(err, f), } diff --git a/planet/src/world_manager.rs b/planet/src/world_manager.rs index 274005e..a56a721 100644 --- a/planet/src/world_manager.rs +++ b/planet/src/world_manager.rs @@ -38,7 +38,7 @@ impl Error for LoadError { } } impl Display for LoadError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { LoadError::MissingSave(_) => f.write_str("No save found at given path"), LoadError::InvalidSave(_) => f.write_str("Loaded file is not a valid save"), @@ -70,7 +70,7 @@ impl Error for SaveError { } } impl Display for SaveError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { SaveError::MissingWorld => f.write_str("No world to save found."), SaveError::SerializationError(_) => f.write_str("Failed to serialize world."), diff --git a/src/gui/widget.rs b/src/gui/widget.rs index 7fee643..a4544db 100644 --- a/src/gui/widget.rs +++ b/src/gui/widget.rs @@ -28,7 +28,7 @@ pub(crate) fn widget(world: &mut World, ui: &mut Ui, instances: HashMap::new(), }); } - world.resource_scope(|world, mut states: Mut<'_, StateInstances>| { + world.resource_scope(|world, mut states: Mut>| { if !states.instances.contains_key(&id) { debug!( "Registering system state for widget {id:?} of type {}", diff --git a/src/gui/widgets/toolbar.rs b/src/gui/widgets/toolbar.rs index 07f3ea7..b1bd937 100644 --- a/src/gui/widgets/toolbar.rs +++ b/src/gui/widgets/toolbar.rs @@ -31,7 +31,7 @@ iterable_enum!(ToolbarButton { impl ToolbarButton { fn clicked(self, world: &mut World) { - world.resource_scope(|world, mut world_manager: Mut<'_, WorldManager>| { + world.resource_scope(|world, mut world_manager: Mut| { match self { ToolbarButton::GenerateWorld => { let generate_world_task = &mut world.resource_mut::(); diff --git a/src/gui/window.rs b/src/gui/window.rs index 486f3f4..c885c8c 100644 --- a/src/gui/window.rs +++ b/src/gui/window.rs @@ -49,7 +49,7 @@ fn window(world: &mut World, ctx: &Context) { instances: HashMap::new(), }); } - world.resource_scope(|world, mut states: Mut<'_, StateInstances>| { + world.resource_scope(|world, mut states: Mut>| { let id: WindowId = S::name().into(); if !states.instances.contains_key(&id) { debug!( diff --git a/src/main.rs b/src/main.rs index 7417e5e..568f461 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,10 +37,10 @@ use { #[cfg(feature = "render")] fn update_cursor_map_position( - mut cursor_map_position: ResMut<'_, CursorMapPosition>, - transform: Query<'_, '_, (&Camera, &GlobalTransform), With>, - windows: Res<'_, Windows>, - world_manager: Res<'_, WorldManager>, + mut cursor_map_position: ResMut, + transform: Query<(&Camera, &GlobalTransform), With>, + windows: Res, + world_manager: Res, ) { let Some(world) = world_manager.get_world() else { return @@ -70,9 +70,9 @@ fn update_cursor_map_position( } fn handle_generate_world_task( - mut generate_world_task: ResMut<'_, GenerateWorldTask>, - mut world_manager: ResMut<'_, WorldManager>, - #[cfg(feature = "render")] mut should_redraw: ResMut<'_, ShouldRedraw>, + mut generate_world_task: ResMut, + mut world_manager: ResMut, + #[cfg(feature = "render")] mut should_redraw: ResMut, ) { if let Some(task) = &mut generate_world_task.0 { if task.is_finished() { @@ -100,10 +100,10 @@ fn handle_generate_world_task( #[cfg(feature = "render")] fn generate_graphics( - mut commands: Commands<'_, '_>, - images: ResMut<'_, Assets>, - egui_context: ResMut<'_, EguiContext>, - render_settings: ResMut<'_, WorldRenderSettings>, + mut commands: Commands, + images: ResMut>, + egui_context: ResMut, + render_settings: ResMut, ) { // Add Julia-Mono font to egui { @@ -180,7 +180,7 @@ fn open_tile_info(mut windows: ResMut, keys: Res>) #[cfg(feature = "render")] fn update_gui(world: &mut World) { - world.resource_scope(|world, mut ctx: Mut<'_, EguiContext>| { + world.resource_scope(|world, mut ctx: Mut| { let ctx = ctx.ctx_mut(); #[cfg(feature = "logging")] { @@ -215,9 +215,9 @@ fn update_gui(world: &mut World) { fn redraw_map( mut should_redraw: ResMut, world_manager: Res, - render_settings: Res<'_, WorldRenderSettings>, + render_settings: Res, mut images: ResMut>, - mut map_sprite: Query<'_, '_, &mut Sprite>, + mut map_sprite: Query<&mut Sprite>, ) { let Some(world) = world_manager.get_world() else { #[cfg(feature = "logging")] diff --git a/src/resources/mod.rs b/src/resources/mod.rs index 57cf392..e1a8dc4 100644 --- a/src/resources/mod.rs +++ b/src/resources/mod.rs @@ -13,7 +13,7 @@ pub(crate) struct CursorMapPosition { } #[cfg(feature = "render")] impl Display for CursorMapPosition { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_fmt(format_args!("x: {}, y: {}", self.x, self.y)) } }