diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index acf62170d5..b5a1236d6e 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -58,7 +58,7 @@ impl<'a> System<'a> for Sys { ); #[allow(clippy::or_fun_call)] // TODO: Pending review in #587 - #[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 + #[allow(clippy::blocks_in_if_conditions)] // TODO: Pending review in #587 fn run( &mut self, ( diff --git a/server/src/cmd.rs b/server/src/cmd.rs index bbceca466e..8e1d17197d 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -92,7 +92,7 @@ fn get_handler(cmd: &ChatCommand) -> CommandHandler { } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_give_item( server: &mut Server, client: EcsEntity, @@ -191,7 +191,7 @@ fn handle_jump( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_goto( server: &mut Server, client: EcsEntity, @@ -333,7 +333,7 @@ fn handle_health( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_alias( server: &mut Server, client: EcsEntity, @@ -380,7 +380,7 @@ fn handle_alias( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::useless_format)] // TODO: Pending review in #587 fn handle_tp( server: &mut Server, @@ -431,7 +431,7 @@ fn handle_tp( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::redundant_clone)] // TODO: Pending review in #587 fn handle_spawn( server: &mut Server, @@ -578,7 +578,7 @@ fn handle_build( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_help( server: &mut Server, client: EcsEntity, @@ -760,7 +760,7 @@ fn handle_light( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_lantern( server: &mut Server, client: EcsEntity, @@ -873,7 +873,7 @@ fn handle_waypoint( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_adminify( server: &mut Server, client: EcsEntity, @@ -915,7 +915,7 @@ fn handle_adminify( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::useless_format)] // TODO: Pending review in #587 fn handle_tell( server: &mut Server, @@ -1002,7 +1002,7 @@ fn handle_debug_column( #[cfg(feature = "worldgen")] #[allow(clippy::blacklisted_name)] // TODO: Pending review in #587 -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_debug_column( server: &mut Server, client: EcsEntity, @@ -1224,7 +1224,7 @@ fn handle_debug( } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn handle_remove_lights( server: &mut Server, client: EcsEntity, @@ -1277,7 +1277,7 @@ fn handle_remove_lights( } #[allow(clippy::chars_next_cmp)] // TODO: Pending review in #587 -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::or_fun_call)] // TODO: Pending review in #587 #[allow(clippy::useless_format)] // TODO: Pending review in #587 fn handle_sudo( diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 9189803e55..389bce0ff4 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -48,7 +48,7 @@ pub fn handle_lantern(server: &mut Server, entity: EcsEntity) { } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn handle_mount(server: &mut Server, mounter: EcsEntity, mountee: EcsEntity) { let state = server.state_mut(); diff --git a/server/src/events/inventory_manip.rs b/server/src/events/inventory_manip.rs index a07d50adb2..4021de541e 100644 --- a/server/src/events/inventory_manip.rs +++ b/server/src/events/inventory_manip.rs @@ -29,7 +29,7 @@ pub fn snuff_lantern(storage: &mut WriteStorage, entity: Ecs storage.remove(entity); } -#[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 +#[allow(clippy::blocks_in_if_conditions)] // TODO: Pending review in #587 #[allow(clippy::let_and_return)] // TODO: Pending review in #587 pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::InventoryManip) { let state = server.state_mut(); diff --git a/server/src/metrics.rs b/server/src/metrics.rs index a5e1c915b3..3fcf94cf4f 100644 --- a/server/src/metrics.rs +++ b/server/src/metrics.rs @@ -33,7 +33,7 @@ pub struct ServerMetrics { } impl TickMetrics { - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn new(registry: &Registry, tick: Arc) -> Result> { let player_online = IntGauge::with_opts(Opts::new( "player_online", diff --git a/server/src/sys/subscription.rs b/server/src/sys/subscription.rs index 7fd52d8613..fbff3e431e 100644 --- a/server/src/sys/subscription.rs +++ b/server/src/sys/subscription.rs @@ -37,7 +37,7 @@ impl<'a> System<'a> for Sys { TrackedComps<'a>, ); - #[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 + #[allow(clippy::blocks_in_if_conditions)] // TODO: Pending review in #587 fn run( &mut self, ( diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index 9a5723601f..537e8ec9a4 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -36,7 +36,7 @@ impl<'a> System<'a> for Sys { WriteStorage<'a, Client>, ); - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::manual_saturating_arithmetic)] // TODO: Pending review in #587 #[allow(clippy::or_fun_call)] // TODO: Pending review in #587 fn run( @@ -398,7 +398,7 @@ impl<'a> System<'a> for Sys { } } -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::manual_saturating_arithmetic)] // TODO: Pending review in #587 pub fn chunk_in_vd( player_pos: Vec3, diff --git a/voxygen/src/anim/character/glidewield.rs b/voxygen/src/anim/character/glidewield.rs index c3509d6495..83d1cb2ee0 100644 --- a/voxygen/src/anim/character/glidewield.rs +++ b/voxygen/src/anim/character/glidewield.rs @@ -9,7 +9,7 @@ impl Animation for GlideWieldAnimation { type Dependency = (Option, Vec3, Vec3, Vec3, f64); type Skeleton = CharacterSkeleton; - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton( skeleton: &Self::Skeleton, (_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/beta.rs b/voxygen/src/anim/src/character/beta.rs index d8a638f4ba..c3ceb00365 100644 --- a/voxygen/src/anim/src/character/beta.rs +++ b/voxygen/src/anim/src/character/beta.rs @@ -12,6 +12,7 @@ impl Animation for BetaAnimation { const UPDATE_FN: &'static [u8] = b"character_beta\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_beta")] + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (active_tool_kind, _velocity, _global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/charge.rs b/voxygen/src/anim/src/character/charge.rs index b5b225f290..817b96cb94 100644 --- a/voxygen/src/anim/src/character/charge.rs +++ b/voxygen/src/anim/src/character/charge.rs @@ -14,7 +14,7 @@ impl Animation for ChargeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_charge")] #[allow(clippy::approx_constant)] // TODO: Pending review in #587 - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (active_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/glidewield.rs b/voxygen/src/anim/src/character/glidewield.rs index 8ccb95b7ac..3e06f02d60 100644 --- a/voxygen/src/anim/src/character/glidewield.rs +++ b/voxygen/src/anim/src/character/glidewield.rs @@ -13,7 +13,7 @@ impl Animation for GlideWieldAnimation { const UPDATE_FN: &'static [u8] = b"character_glidewield\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_glidewield")] - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/gliding.rs b/voxygen/src/anim/src/character/gliding.rs index 896fba32f8..1d1425b412 100644 --- a/voxygen/src/anim/src/character/gliding.rs +++ b/voxygen/src/anim/src/character/gliding.rs @@ -13,7 +13,7 @@ impl Animation for GlidingAnimation { const UPDATE_FN: &'static [u8] = b"character_gliding\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_gliding")] - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/jump.rs b/voxygen/src/anim/src/character/jump.rs index 7ca28e6e9d..b6033ca9b4 100644 --- a/voxygen/src/anim/src/character/jump.rs +++ b/voxygen/src/anim/src/character/jump.rs @@ -11,7 +11,7 @@ impl Animation for JumpAnimation { const UPDATE_FN: &'static [u8] = b"character_jump\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_jump")] - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (_active_tool_kind, orientation, last_ori, global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/roll.rs b/voxygen/src/anim/src/character/roll.rs index 17b2bac556..fc31acf2d6 100644 --- a/voxygen/src/anim/src/character/roll.rs +++ b/voxygen/src/anim/src/character/roll.rs @@ -12,7 +12,7 @@ impl Animation for RollAnimation { const UPDATE_FN: &'static [u8] = b"character_roll\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_roll")] - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (_active_tool_kind, orientation, last_ori, _global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/run.rs b/voxygen/src/anim/src/character/run.rs index 595010670e..84da7ec394 100644 --- a/voxygen/src/anim/src/character/run.rs +++ b/voxygen/src/anim/src/character/run.rs @@ -13,7 +13,7 @@ impl Animation for RunAnimation { const UPDATE_FN: &'static [u8] = b"character_run\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_run")] - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/spin.rs b/voxygen/src/anim/src/character/spin.rs index 2ab47f316e..b0c27705af 100644 --- a/voxygen/src/anim/src/character/spin.rs +++ b/voxygen/src/anim/src/character/spin.rs @@ -16,6 +16,7 @@ impl Animation for SpinAnimation { const UPDATE_FN: &'static [u8] = b"character_spin\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_spin")] + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (active_tool_kind, _global_time): Self::Dependency, diff --git a/voxygen/src/anim/src/character/swim.rs b/voxygen/src/anim/src/character/swim.rs index 71147021fb..3254df699f 100644 --- a/voxygen/src/anim/src/character/swim.rs +++ b/voxygen/src/anim/src/character/swim.rs @@ -13,7 +13,7 @@ impl Animation for SwimAnimation { const UPDATE_FN: &'static [u8] = b"character_swim\0"; #[cfg_attr(feature = "be-dyn-lib", export_name = "character_swim")] - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn update_skeleton_inner( skeleton: &Self::Skeleton, (_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency, diff --git a/voxygen/src/ecs/sys/floater.rs b/voxygen/src/ecs/sys/floater.rs index c44afe1275..0b2334bda9 100644 --- a/voxygen/src/ecs/sys/floater.rs +++ b/voxygen/src/ecs/sys/floater.rs @@ -28,7 +28,7 @@ impl<'a> System<'a> for Sys { WriteStorage<'a, HpFloaterList>, ); - #[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 + #[allow(clippy::blocks_in_if_conditions)] // TODO: Pending review in #587 fn run( &mut self, (entities, my_entity, dt, mut my_exp_floater_list, uids, pos, stats, mut hp_floater_lists): Self::SystemData, diff --git a/voxygen/src/hud/hotbar.rs b/voxygen/src/hud/hotbar.rs index b6c00f6079..ca5f842644 100644 --- a/voxygen/src/hud/hotbar.rs +++ b/voxygen/src/hud/hotbar.rs @@ -64,6 +64,7 @@ impl State { // TODO: remove // Adds ability3 slot if it is missing and should be present // Removes if it is there and shouldn't be present + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 pub fn maintain_ability3(&mut self, client: &client::Client) { use specs::WorldExt; let loadouts = client.state().ecs().read_storage::(); diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 1cbf758d82..c71be59eb8 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -2154,7 +2154,7 @@ impl Hud { handled } - #[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 + #[allow(clippy::blocks_in_if_conditions)] // TODO: Pending review in #587 pub fn maintain( &mut self, client: &Client, diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index bd5281d087..575fd9b344 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -399,6 +399,7 @@ impl CharSelectionUi { // TODO: Split this into multiple modules or functions. #[allow(clippy::useless_let_if_seq)] // TODO: Pending review in #587 #[allow(clippy::unnecessary_operation)] // TODO: Pending review in #587 + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 fn update_layout(&mut self, client: &mut Client) -> Vec { let mut events = Vec::new(); diff --git a/voxygen/src/render/error.rs b/voxygen/src/render/error.rs index b2e659565f..dcf74680d9 100644 --- a/voxygen/src/render/error.rs +++ b/voxygen/src/render/error.rs @@ -17,7 +17,7 @@ impl From> for RenderError { } impl From> for RenderError { - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn from(err: gfx::PipelineStateError<&str>) -> Self { match err { gfx::PipelineStateError::DescriptorInit(err) => { diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index 851e4fbd88..08106b0953 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -1981,7 +1981,7 @@ impl Terrain { } /// Maintain terrain data. To be called once per tick. - #[allow(clippy::for_loop_over_option)] // TODO: Pending review in #587 + #[allow(clippy::for_loops_over_fallibles)] // TODO: Pending review in #587 #[allow(clippy::len_zero)] // TODO: Pending review in #587 pub fn maintain( &mut self, diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 38a81ec230..4219bd5424 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -25,7 +25,7 @@ impl<'a> BlockGen<'a> { } } - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn sample_column<'b>( column_gen: &ColumnGen<'a>, cache: &'b mut SmallCache>>, @@ -36,7 +36,7 @@ impl<'a> BlockGen<'a> { .as_ref() } - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 fn get_cliff_height( column_gen: &ColumnGen<'a>, cache: &mut SmallCache>>, @@ -91,7 +91,7 @@ impl<'a> BlockGen<'a> { ) } - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn get_z_cache(&mut self, wpos: Vec2) -> Option> { let BlockGen { column_cache, diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 28d0982a4f..d75ca1f65a 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -70,7 +70,7 @@ impl<'a, R: Rng> GenCtx<'a, R> { } impl Civs { - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn generate(seed: u32, sim: &mut WorldSim) -> Self { let mut this = Self::default(); let rng = ChaChaRng::from_seed(seed_expan::rng_state(seed)); @@ -602,7 +602,7 @@ fn loc_suitable_for_site(sim: &WorldSim, loc: Vec2) -> bool { } /// Attempt to search for a location that's suitable for site construction -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::or_fun_call)] // TODO: Pending review in #587 fn find_site_loc(ctx: &mut GenCtx, near: Option<(Vec2, f32)>) -> Option> { const MAX_ATTEMPTS: usize = 100; diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index f587ceba86..7a0619b51f 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -173,6 +173,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { #[allow(clippy::if_same_then_else)] // TODO: Pending review in #587 #[allow(clippy::nonminimal_bool)] // TODO: Pending review in #587 #[allow(clippy::single_match)] // TODO: Pending review in #587 + #[allow(clippy::bind_instead_of_map)] // TODO: Pending review in #587 fn get(&self, wpos: Vec2) -> Option> { let wposf = wpos.map(|e| e as f64); let chunk_pos = wpos.map2(TerrainChunkSize::RECT_SIZE, |e, sz: u32| e / sz as i32); diff --git a/world/src/lib.rs b/world/src/lib.rs index f23feeb106..dc94f436b8 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -64,7 +64,7 @@ impl World { pub fn sample_blocks(&self) -> BlockGen { BlockGen::new(ColumnGen::new(&self.sim)) } - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[allow(clippy::or_fun_call)] // TODO: Pending review in #587 pub fn generate_chunk( &self, diff --git a/world/src/sim/map.rs b/world/src/sim/map.rs index bed455e5aa..6dd4544d80 100644 --- a/world/src/sim/map.rs +++ b/world/src/sim/map.rs @@ -109,7 +109,8 @@ impl MapConfig { /// to the caller to provide a function that translates this information /// into the correct format for a buffer and writes to it. #[allow(clippy::if_same_then_else)] // TODO: Pending review in #587 - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 #[allow(clippy::many_single_char_names)] pub fn generate( &self, diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 67d5d57e14..5a073f1d93 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -306,6 +306,7 @@ pub struct WorldSim { impl WorldSim { #[allow(clippy::if_same_then_else)] // TODO: Pending review in #587 #[allow(clippy::let_and_return)] // TODO: Pending review in #587 + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 pub fn generate(seed: u32, opts: WorldOpts) -> Self { let mut rng = ChaChaRng::from_seed(seed_expan::rng_state(seed)); @@ -1321,7 +1322,7 @@ impl WorldSim { } /// Prepare the world for simulation - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn seed_elements(&mut self) { let mut rng = self.rng.clone(); @@ -1490,7 +1491,7 @@ impl WorldSim { } } - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn get_gradient_approx(&self, chunk_pos: Vec2) -> Option { let a = self.get(chunk_pos)?; if let Some(downhill) = a.downhill { @@ -1509,7 +1510,7 @@ impl WorldSim { self.get_interpolated(wpos, |chunk| chunk.alt) } - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn get_wpos(&self, wpos: Vec2) -> Option<&SimChunk> { self.get( wpos.map2(Vec2::from(TerrainChunkSize::RECT_SIZE), |e, sz: u32| { @@ -1710,7 +1711,7 @@ impl WorldSim { Some(z0 + z1 + z2 + z3) } - #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn get_nearest_path(&self, wpos: Vec2) -> Option<(f32, Vec2)> { let chunk_pos = wpos.map2(Vec2::from(TerrainChunkSize::RECT_SIZE), |e, sz: u32| { e.div_euclid(sz as i32) @@ -1816,6 +1817,7 @@ pub struct RegionInfo { impl SimChunk { #[allow(clippy::if_same_then_else)] // TODO: Pending review in #587 + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 fn generate(posi: usize, gen_ctx: &GenCtx, gen_cdf: &GenCdf) -> Self { let pos = uniform_idx_as_vec2(posi); let wposf = (pos * TerrainChunkSize::RECT_SIZE.map(|e| e as i32)).map(|e| e as f64); diff --git a/world/src/sim/util.rs b/world/src/sim/util.rs index 36c6b970f6..679bce94b0 100644 --- a/world/src/sim/util.rs +++ b/world/src/sim/util.rs @@ -217,7 +217,7 @@ pub fn uniform_noise( /// guarantees that for any point between the given chunk (on the top left) and /// its top-right/down-right/down neighbors, the twelve chunks surrounding this /// box (its "perimeter") are also inspected. -#[allow(clippy::identity_conversion)] // TODO: Pending review in #587 +#[allow(clippy::useless_conversion)] // TODO: Pending review in #587 pub fn local_cells(posi: usize) -> impl Clone + Iterator { let pos = uniform_idx_as_vec2(posi); // NOTE: want to keep this such that the chunk index is in ascending order! diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index a805c6847e..8f3124d705 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -370,6 +370,7 @@ impl Floor { } } + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 fn create_route(&mut self, _ctx: &mut GenCtx, a: Vec2, b: Vec2) { let heuristic = move |l: &Vec2| (l - b).map(|e| e.abs()).reduce_max() as f32; let neighbors = |l: &Vec2| { @@ -567,6 +568,7 @@ impl Floor { .min_by_key(|nearest| rpos.distance_squared(*nearest)) } + #[allow(clippy::unnested_or_patterns)] // TODO: Pending review in #587 pub fn col_sampler(&self, pos: Vec2, floor_z: i32) -> impl FnMut(i32) -> BlockMask + '_ { let rpos = pos - self.tile_offset * TILE_SIZE; let tile_pos = rpos.map(|e| e.div_euclid(TILE_SIZE)); diff --git a/world/src/site/settlement/mod.rs b/world/src/site/settlement/mod.rs index b45a48c1f7..be659d840f 100644 --- a/world/src/site/settlement/mod.rs +++ b/world/src/site/settlement/mod.rs @@ -151,7 +151,7 @@ impl Settlement { pub fn get_origin(&self) -> Vec2 { self.origin } /// Designate hazardous terrain based on world data - #[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 + #[allow(clippy::blocks_in_if_conditions)] // TODO: Pending review in #587 pub fn designate_from_world(&mut self, sim: &WorldSim, rng: &mut impl Rng) { let tile_radius = self.radius() as i32 / AREA_SIZE as i32; let hazard = self.land.hazard;