diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 0000000000..5146b9297c --- /dev/null +++ b/clippy.toml @@ -0,0 +1,22 @@ +# TODO: do we want to use `#[deny(clippy::disallowed_method)]` to disallow all unwraps (possibly only in non-test code)? +#disallowed-methods = [ +# "std::option::Option::unwrap", +# "std::result::Result::unwrap", +#] + +# The `too_many_arguments`, `many_single_char_names`, and `type_complexity` +# lints give sufficiently many false positives that they're worth disabling +# globally via raising their thresholds. + +# `too_many_arguments` often flags `new` methods on structs that legitimately +# ought to have many parameters +too-many-arguments-threshold = 15 + +# `many_single_char_names` often triggers for geometry or physics code with an +# associated diagram, where the short names are points in the diagram. +single-char-binding-names-threshold = 8 + +# `type_complexity` often triggers for the RHS of an associated type: it's +# telling you that a type is complicated enough to need a name, at the point +# where you're giving it a name. +type-complexity-threshold = 750 diff --git a/common/net/src/msg/compression.rs b/common/net/src/msg/compression.rs index 53fa1c3c21..f9f92de363 100644 --- a/common/net/src/msg/compression.rs +++ b/common/net/src/msg/compression.rs @@ -190,7 +190,6 @@ pub struct QuadPngEncoding(); impl VoxelImageEncoding for QuadPngEncoding { type Output = CompressedData<(Vec, [usize; 3])>; - #[allow(clippy::type_complexity)] type Workspace = ( ImageBuffer, Vec>, ImageBuffer, Vec>, @@ -464,9 +463,7 @@ impl VoxelImageDecoding for QuadPngEncoding { pub struct TriPngEncoding(); impl VoxelImageEncoding for TriPngEncoding { - #[allow(clippy::type_complexity)] type Output = CompressedData<(Vec, Vec>, [usize; 3])>; - #[allow(clippy::type_complexity)] type Workspace = ( ImageBuffer, Vec>, ImageBuffer, Vec>, diff --git a/common/net/src/sync/packet.rs b/common/net/src/sync/packet.rs index 3dc1e642bd..d30a32ac59 100644 --- a/common/net/src/sync/packet.rs +++ b/common/net/src/sync/packet.rs @@ -137,7 +137,7 @@ pub struct CompSyncPackage { } impl CompSyncPackage

{ - #[allow(clippy::new_without_default)] // TODO: Pending review in #587 + #[allow(clippy::new_without_default)] pub fn new() -> Self { Self { comp_updates: Vec::new(), diff --git a/common/src/combat.rs b/common/src/combat.rs index 8370fa5372..32d5a7d604 100644 --- a/common/src/combat.rs +++ b/common/src/combat.rs @@ -176,7 +176,6 @@ impl Attack { 1.0 - (1.0 - damage_reduction) * (1.0 - block_reduction) } - #[allow(clippy::too_many_arguments)] pub fn apply_attack( &self, attacker: Option, diff --git a/common/src/comp/agent.rs b/common/src/comp/agent.rs index a69b000612..5b171bfccd 100644 --- a/common/src/comp/agent.rs +++ b/common/src/comp/agent.rs @@ -459,7 +459,6 @@ impl Timer { } } -#[allow(clippy::type_complexity)] #[derive(Clone, Debug)] pub struct Agent { pub rtsim_controller: RtSimController, @@ -533,7 +532,6 @@ impl Agent { self } - #[allow(clippy::type_complexity)] #[must_use] pub fn with_position_pid_controller( mut self, diff --git a/common/src/comp/group.rs b/common/src/comp/group.rs index 3de7991fce..813fb827e1 100644 --- a/common/src/comp/group.rs +++ b/common/src/comp/group.rs @@ -155,7 +155,6 @@ impl GroupManager { // Add someone to a group // Also used to create new groups - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 pub fn add_group_member( &mut self, leader: specs::Entity, @@ -257,7 +256,6 @@ impl GroupManager { }); } - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 pub fn new_pet( &mut self, pet: specs::Entity, @@ -336,7 +334,6 @@ impl GroupManager { // Remove someone from a group if they are in one // Don't need to check if they are in a group before calling this // Also removes pets (ie call this if the pet no longer exists) - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 fn remove_from_group( &mut self, member: specs::Entity, diff --git a/common/src/event.rs b/common/src/event.rs index 34d36f3017..cea01301a5 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -107,7 +107,6 @@ pub enum ServerEvent { }, UpdateCharacterData { entity: EcsEntity, - #[allow(clippy::type_complexity)] components: ( comp::Body, comp::Stats, diff --git a/common/src/figure/mod.rs b/common/src/figure/mod.rs index ab65d386ee..cbaaad9d89 100644 --- a/common/src/figure/mod.rs +++ b/common/src/figure/mod.rs @@ -113,7 +113,7 @@ impl Segment { pub struct DynaUnionizer(Vec<(Dyna, Vec3)>); impl DynaUnionizer { - #[allow(clippy::new_without_default)] // TODO: Pending review in #587 + #[allow(clippy::new_without_default)] pub fn new() -> Self { DynaUnionizer(Vec::new()) } #[must_use] diff --git a/common/src/recipe.rs b/common/src/recipe.rs index 5da4ba71dc..eb4d330005 100644 --- a/common/src/recipe.rs +++ b/common/src/recipe.rs @@ -24,7 +24,6 @@ pub struct Recipe { pub craft_sprite: Option, } -#[allow(clippy::type_complexity)] impl Recipe { /// Perform a recipe, returning a list of missing items on failure pub fn craft_simple( diff --git a/common/src/region.rs b/common/src/region.rs index 9e89579912..f8c1e7fda3 100644 --- a/common/src/region.rs +++ b/common/src/region.rs @@ -13,6 +13,7 @@ pub enum Event { } /// Region consisting of a bitset of entities within it +#[derive(Default)] pub struct Region { // Use specs bitset for simplicity (and joinability) bitset: BitSet, @@ -23,14 +24,6 @@ pub struct Region { events: Vec, } impl Region { - fn new() -> Self { - Self { - bitset: BitSet::new(), - neighbors: [None; 8], - events: Vec::new(), - } - } - /// Checks if the region contains no entities and no events fn removable(&self) -> bool { self.bitset.is_empty() && self.events.is_empty() } @@ -70,6 +63,7 @@ const NEIGHBOR_OFFSETS: [Vec2; 8] = [ Vec2::new(1, 1), ]; +#[derive(Default)] // TODO generic region size (16x16 for now) // TODO compare to sweep and prune approach /// A region system that tracks where entities are @@ -87,20 +81,11 @@ pub struct RegionMap { // (region, entity) entities_to_remove: Vec<(usize, u32)>, // Track the current tick, used to enable not checking everything every tick + // rate is dependent on the rate the caller calls region_manager.tick() tick: u64, } impl RegionMap { - #[allow(clippy::new_without_default)] // TODO: Pending review in #587 - pub fn new() -> Self { - Self { - regions: IndexMap::default(), - tracked_entities: BitSet::new(), - entities_to_move: Vec::new(), - entities_to_remove: Vec::new(), - // rate is dependent on the rate the caller calls region_manager.tick() - tick: 0, - } - } + pub fn new() -> Self { Self::default() } // TODO maintain within a system? // TODO special case large entities @@ -269,7 +254,7 @@ impl RegionMap { /// Adds a new region /// Returns the index of the region in the index map fn insert(&mut self, key: Vec2) -> usize { - let (index, old_region) = self.regions.insert_full(key, Region::new()); + let (index, old_region) = self.regions.insert_full(key, Region::default()); if old_region.is_some() { panic!("Inserted a region that already exists!!!(this should never need to occur"); } diff --git a/common/src/spiral.rs b/common/src/spiral.rs index fc763a8278..a5c084ba31 100644 --- a/common/src/spiral.rs +++ b/common/src/spiral.rs @@ -9,20 +9,22 @@ pub struct Spiral2d { } impl Spiral2d { - #[allow(clippy::new_without_default)] // TODO: Pending review in #587 + #[allow(clippy::new_without_default)] /// Creates a new spiral starting at the origin pub fn new() -> Self { Self { layer: 0, i: 0 } } /// Creates an iterator over points in a spiral starting at the origin and /// going out to some radius - pub fn radius(self, radius: i32) -> impl Iterator> { - self.take((radius * 2 + 1).pow(2) as usize) + pub fn with_radius(radius: i32) -> impl Iterator> { + Self::new() + .take((radius * 2 + 1).pow(2) as usize) .filter(move |pos| pos.magnitude_squared() < (radius + 1).pow(2)) } /// Creates an iterator over points in the edge of a circle of some radius - pub fn edge_radius(self, radius: i32) -> impl Iterator> { - self.take((radius * 2 + 1).pow(2) as usize) + pub fn with_edge_radius(radius: i32) -> impl Iterator> { + Self::new() + .take((radius * 2 + 1).pow(2) as usize) .filter(move |pos| pos.magnitude_squared() < (radius + 1).pow(2)) .filter(move |pos| pos.magnitude_squared() >= radius.pow(2)) } diff --git a/common/src/states/sprite_summon.rs b/common/src/states/sprite_summon.rs index 01f11a432d..0483de1bce 100644 --- a/common/src/states/sprite_summon.rs +++ b/common/src/states/sprite_summon.rs @@ -85,7 +85,7 @@ impl CharacterBehavior for Data { // 1 added to make range correct, too lazy to add 1 to both variables above let radius = radius + 1; // Creates a spiral iterator for the newly achieved radius - let spiral = Spiral2d::new().edge_radius(radius); + let spiral = Spiral2d::with_edge_radius(radius); for point in spiral { // If square is not sparse, generate sprite if !thread_rng().gen_bool(self.static_data.sparseness) { diff --git a/common/src/terrain/chonk.rs b/common/src/terrain/chonk.rs index a4c2e60766..bc358d5c0f 100644 --- a/common/src/terrain/chonk.rs +++ b/common/src/terrain/chonk.rs @@ -245,7 +245,6 @@ impl Iterator for ChonkIterHelper { } } -#[allow(clippy::type_complexity)] // TODO: Pending review in #587 pub struct ChonkPosIter { outer: ChonkIterHelper, opt_inner: Option<(i32, ChunkPosIter, M>)>, diff --git a/common/src/terrain/mod.rs b/common/src/terrain/mod.rs index 5206945d5b..1dc4bcbf5a 100644 --- a/common/src/terrain/mod.rs +++ b/common/src/terrain/mod.rs @@ -91,7 +91,6 @@ pub struct TerrainChunkMeta { contains_dungeon: bool, } -#[allow(clippy::too_many_arguments)] impl TerrainChunkMeta { pub fn new( name: Option, diff --git a/common/src/vol.rs b/common/src/vol.rs index 2fc8ef4477..f26855f399 100644 --- a/common/src/vol.rs +++ b/common/src/vol.rs @@ -98,7 +98,6 @@ pub trait ReadVol: BaseVol { /// Get a reference to the voxel at the provided position in the volume. fn get(&self, pos: Vec3) -> Result<&Self::Vox, Self::Error>; - #[allow(clippy::type_complexity)] // TODO: Pending review in #587 /// NOTE: By default, this ray will simply run from `from` to `to` without /// stopping. To make something interesting happen, call `until` or /// `for_each`. diff --git a/common/systems/src/beam.rs b/common/systems/src/beam.rs index 1ff263796b..55010f688e 100644 --- a/common/systems/src/beam.rs +++ b/common/systems/src/beam.rs @@ -310,7 +310,6 @@ impl<'a> System<'a> for Sys { /// Assumes upright cylinder /// See page 12 of https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.396.7952&rep=rep1&type=pdf -#[allow(clippy::too_many_arguments)] fn sphere_wedge_cylinder_collision( // Values for spherical wedge real_pos: Vec3, diff --git a/common/systems/src/character_behavior.rs b/common/systems/src/character_behavior.rs index fd0531eb04..d2015a903b 100644 --- a/common/systems/src/character_behavior.rs +++ b/common/systems/src/character_behavior.rs @@ -57,7 +57,6 @@ pub struct ReadData<'a> { pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( ReadData<'a>, WriteStorage<'a, CharacterState>, diff --git a/common/systems/src/mount.rs b/common/systems/src/mount.rs index 82b43dbf13..1cfb25e68d 100644 --- a/common/systems/src/mount.rs +++ b/common/systems/src/mount.rs @@ -15,7 +15,6 @@ use vek::*; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Read<'a, UidAllocator>, Entities<'a>, diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index ed9dec8e91..e19ca2021b 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -41,7 +41,6 @@ fn fluid_density(height: f32, fluid: &Fluid) -> Density { Density(fluid.density().0 * immersion + AIR_DENSITY * (1.0 - immersion)) } -#[allow(clippy::too_many_arguments)] fn integrate_forces( dt: &DeltaTime, mut vel: Vel, @@ -1319,7 +1318,7 @@ impl<'a> System<'a> for Sys { } } -#[allow(clippy::too_many_arguments, clippy::too_many_lines)] +#[allow(clippy::too_many_lines)] fn box_voxel_collision<'a, T: BaseVol + ReadVol>( cylinder: (f32, f32, f32), // effective collision cylinder terrain: &'a T, @@ -1944,8 +1943,6 @@ fn projection_between(c0: ColliderContext, c1: ColliderContext) -> (Vec2, f /// unspecified pair of points that sit on the line segments will be chosen. fn closest_points(n: LineSegment2, m: LineSegment2) -> (Vec2, Vec2) { // TODO: Rewrite this to something reasonable, if you have faith - #![allow(clippy::many_single_char_names)] - let a = n.start; let b = n.end - n.start; let c = m.start; diff --git a/common/systems/src/stats.rs b/common/systems/src/stats.rs index 52e277071b..57510eeeba 100644 --- a/common/systems/src/stats.rs +++ b/common/systems/src/stats.rs @@ -34,7 +34,6 @@ pub struct ReadData<'a> { #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( ReadData<'a>, WriteStorage<'a, Stats>, diff --git a/network/src/api.rs b/network/src/api.rs index b711246c3c..9c3393d389 100644 --- a/network/src/api.rs +++ b/network/src/api.rs @@ -760,7 +760,6 @@ impl Participant { } impl Stream { - #[allow(clippy::too_many_arguments)] pub(crate) fn new( local_pid: Pid, remote_pid: Pid, diff --git a/network/src/participant.rs b/network/src/participant.rs index 15410ee3f3..342759c1e2 100644 --- a/network/src/participant.rs +++ b/network/src/participant.rs @@ -85,7 +85,6 @@ impl BParticipant { const TICK_TIME: Duration = Duration::from_millis(Self::TICK_TIME_MS); const TICK_TIME_MS: u64 = 5; - #[allow(clippy::type_complexity)] pub(crate) fn new( local_pid: Pid, remote_pid: Pid, @@ -223,7 +222,6 @@ impl BParticipant { } //TODO: local stream_cid: HashMap to know the respective protocol - #[allow(clippy::too_many_arguments)] async fn send_mgr( &self, mut a2b_open_stream_r: mpsc::UnboundedReceiver, @@ -781,7 +779,6 @@ mod tests { task::JoinHandle, }; - #[allow(clippy::type_complexity)] fn mock_bparticipant() -> ( Arc, mpsc::UnboundedSender, diff --git a/server/src/client.rs b/server/src/client.rs index bc45cd45a0..19bd322049 100644 --- a/server/src/client.rs +++ b/server/src/client.rs @@ -44,7 +44,6 @@ impl Component for Client { } impl Client { - #[allow(clippy::too_many_arguments)] pub(crate) fn new( client_type: ClientType, participant: Participant, diff --git a/server/src/events/entity_creation.rs b/server/src/events/entity_creation.rs index 2df15f1795..3b49e2ca20 100644 --- a/server/src/events/entity_creation.rs +++ b/server/src/events/entity_creation.rs @@ -30,7 +30,6 @@ pub fn handle_initialize_character( server.state.initialize_character_data(entity, character_id); } -#[allow(clippy::type_complexity)] pub fn handle_loaded_character_data( server: &mut Server, entity: EcsEntity, @@ -42,7 +41,6 @@ pub fn handle_loaded_character_data( sys::subscription::initialize_region_subscription(server.state.ecs(), entity); } -#[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 pub fn handle_create_npc( server: &mut Server, pos: Pos, @@ -161,7 +159,6 @@ pub fn handle_create_ship( entity.build(); } -#[allow(clippy::too_many_arguments)] pub fn handle_shoot( server: &mut Server, entity: EcsEntity, diff --git a/server/src/rtsim/tick.rs b/server/src/rtsim/tick.rs index ea16a7e388..6b6571904f 100644 --- a/server/src/rtsim/tick.rs +++ b/server/src/rtsim/tick.rs @@ -16,7 +16,6 @@ use std::sync::Arc; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Read<'a, Time>, Read<'a, DeltaTime>, diff --git a/server/src/rtsim/unload_chunks.rs b/server/src/rtsim/unload_chunks.rs index 3bc49931cd..5433164dc3 100644 --- a/server/src/rtsim/unload_chunks.rs +++ b/server/src/rtsim/unload_chunks.rs @@ -10,7 +10,6 @@ use specs::{Entities, Read, ReadExpect, ReadStorage, WriteExpect}; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Read<'a, EventBus>, WriteExpect<'a, RtSim>, diff --git a/server/src/state_ext.rs b/server/src/state_ext.rs index 7c32742f1b..e55db922f5 100644 --- a/server/src/state_ext.rs +++ b/server/src/state_ext.rs @@ -42,7 +42,6 @@ pub trait StateExt { /// Updates a component associated with the entity based on the `Effect` fn apply_effect(&self, entity: EcsEntity, effect: Effect, source: Option); /// Build a non-player character - #[allow(clippy::too_many_arguments)] fn create_npc( &mut self, pos: comp::Pos, diff --git a/server/src/sys/agent.rs b/server/src/sys/agent.rs index 7255130477..4fc8ae11e3 100644 --- a/server/src/sys/agent.rs +++ b/server/src/sys/agent.rs @@ -66,7 +66,6 @@ use vek::*; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( ReadData<'a>, Write<'a, EventBus>, @@ -2178,7 +2177,6 @@ impl<'a> AgentData<'a> { /// multiplies the movement speed by a value less than 1.0. /// A `None` value implies a multiplier of 1.0. /// Returns `false` if the pathfinding algorithm fails to return a path - #[allow(clippy::too_many_arguments)] fn path_toward_target( &self, agent: &mut Agent, diff --git a/server/src/sys/metrics.rs b/server/src/sys/metrics.rs index 17b0c84338..07c79dfd22 100644 --- a/server/src/sys/metrics.rs +++ b/server/src/sys/metrics.rs @@ -11,7 +11,6 @@ use std::time::Instant; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Option>, ReadExpect<'a, HwStats>, diff --git a/server/src/sys/msg/character_screen.rs b/server/src/sys/msg/character_screen.rs index c0ac176f13..f71ed783bc 100644 --- a/server/src/sys/msg/character_screen.rs +++ b/server/src/sys/msg/character_screen.rs @@ -18,7 +18,6 @@ use std::sync::atomic::Ordering; use tracing::{debug, warn}; impl Sys { - #[allow(clippy::too_many_arguments)] fn handle_client_character_screen_msg( server_emitter: &mut common::event::Emitter<'_, ServerEvent>, entity: specs::Entity, @@ -186,7 +185,6 @@ impl Sys { #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, EventBus>, diff --git a/server/src/sys/msg/general.rs b/server/src/sys/msg/general.rs index 0bfada3a31..68b4665f14 100644 --- a/server/src/sys/msg/general.rs +++ b/server/src/sys/msg/general.rs @@ -67,7 +67,6 @@ impl Sys { #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, EventBus>, diff --git a/server/src/sys/msg/ping.rs b/server/src/sys/msg/ping.rs index 55315fdab1..82e42612a3 100644 --- a/server/src/sys/msg/ping.rs +++ b/server/src/sys/msg/ping.rs @@ -22,7 +22,6 @@ impl Sys { #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, EventBus>, diff --git a/server/src/sys/msg/terrain.rs b/server/src/sys/msg/terrain.rs index bf6c81b715..13d495cddf 100644 --- a/server/src/sys/msg/terrain.rs +++ b/server/src/sys/msg/terrain.rs @@ -15,7 +15,6 @@ use tracing::{debug, trace}; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, ReadExpect<'a, TerrainGrid>, diff --git a/server/src/sys/object.rs b/server/src/sys/object.rs index 44533ce8e1..7e3754e20d 100644 --- a/server/src/sys/object.rs +++ b/server/src/sys/object.rs @@ -12,7 +12,6 @@ use specs::{Entities, Join, Read, ReadStorage, WriteStorage}; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, DeltaTime>, diff --git a/server/src/sys/persistence.rs b/server/src/sys/persistence.rs index f483f7be00..ed3ecc9495 100644 --- a/server/src/sys/persistence.rs +++ b/server/src/sys/persistence.rs @@ -14,7 +14,6 @@ use specs::{Join, ReadStorage, Write, WriteExpect}; pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( ReadStorage<'a, Alignment>, ReadStorage<'a, Body>, diff --git a/server/src/sys/pets.rs b/server/src/sys/pets.rs index d958bcfab5..67b7862a61 100644 --- a/server/src/sys/pets.rs +++ b/server/src/sys/pets.rs @@ -12,7 +12,6 @@ use specs::{ #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, ReadExpect<'a, TerrainGrid>, diff --git a/server/src/sys/subscription.rs b/server/src/sys/subscription.rs index 6b160bb2d6..90382749d1 100644 --- a/server/src/sys/subscription.rs +++ b/server/src/sys/subscription.rs @@ -22,7 +22,6 @@ use vek::*; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, ReadExpect<'a, RegionMap>, diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index d7b0c26ef9..da82953974 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -106,7 +106,7 @@ impl LazyTerrainMessage { #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] // TODO: Pending review in #587 + #[allow(clippy::type_complexity)] type SystemData = ( Read<'a, EventBus>, Read<'a, Tick>, diff --git a/server/src/sys/terrain_sync.rs b/server/src/sys/terrain_sync.rs index 7f9c887fcf..e737c1c582 100644 --- a/server/src/sys/terrain_sync.rs +++ b/server/src/sys/terrain_sync.rs @@ -11,7 +11,6 @@ use specs::{Join, Read, ReadExpect, ReadStorage}; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( ReadExpect<'a, TerrainGrid>, Read<'a, TerrainChanges>, diff --git a/server/src/sys/waypoint.rs b/server/src/sys/waypoint.rs index 2569e543f0..1b7cb8dd44 100644 --- a/server/src/sys/waypoint.rs +++ b/server/src/sys/waypoint.rs @@ -15,7 +15,6 @@ const NOTIFY_TIME: f64 = 10.0; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, ReadStorage<'a, Pos>, diff --git a/server/src/sys/wiring/dispatch_actions.rs b/server/src/sys/wiring/dispatch_actions.rs index 6eeee7bb08..b6a88fde3c 100644 --- a/server/src/sys/wiring/dispatch_actions.rs +++ b/server/src/sys/wiring/dispatch_actions.rs @@ -68,7 +68,6 @@ pub fn dispatch_actions(system_data: &mut WiringData) { ) } -#[allow(clippy::too_many_arguments)] fn dispatch_action( entity: Entity, inputs: &HashMap, @@ -123,7 +122,6 @@ fn dispatch_action_spawn_projectile( }); } -#[allow(clippy::too_many_arguments)] fn dispatch_action_set_light( inputs: &HashMap, r: &OutputFormula, diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index 301e787c95..1b1b605513 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -11,7 +11,6 @@ use core::f32::consts::PI; pub struct AlphaAnimation; impl Animation for AlphaAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/biped_large/beam.rs b/voxygen/anim/src/biped_large/beam.rs index 7dbd9d3145..695353e74e 100644 --- a/voxygen/anim/src/biped_large/beam.rs +++ b/voxygen/anim/src/biped_large/beam.rs @@ -11,7 +11,6 @@ use core::f32::consts::PI; pub struct BeamAnimation; impl Animation for BeamAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/biped_large/beta.rs b/voxygen/anim/src/biped_large/beta.rs index 4578ef6478..ef1102a4b4 100644 --- a/voxygen/anim/src/biped_large/beta.rs +++ b/voxygen/anim/src/biped_large/beta.rs @@ -11,7 +11,6 @@ use std::f32::consts::PI; pub struct BetaAnimation; impl Animation for BetaAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/biped_large/chargemelee.rs b/voxygen/anim/src/biped_large/chargemelee.rs index 4ea74651ea..2ffc08db44 100644 --- a/voxygen/anim/src/biped_large/chargemelee.rs +++ b/voxygen/anim/src/biped_large/chargemelee.rs @@ -11,7 +11,6 @@ use core::f32::consts::PI; pub struct ChargeMeleeAnimation; impl Animation for ChargeMeleeAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/biped_large/dash.rs b/voxygen/anim/src/biped_large/dash.rs index 8920d939ca..046c877c53 100644 --- a/voxygen/anim/src/biped_large/dash.rs +++ b/voxygen/anim/src/biped_large/dash.rs @@ -11,7 +11,6 @@ use core::f32::consts::PI; pub struct DashAnimation; impl Animation for DashAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/biped_large/selfbuff.rs b/voxygen/anim/src/biped_large/selfbuff.rs index 3643987ee5..2448cf522d 100644 --- a/voxygen/anim/src/biped_large/selfbuff.rs +++ b/voxygen/anim/src/biped_large/selfbuff.rs @@ -11,7 +11,6 @@ use core::f32::consts::PI; pub struct SelfBuffAnimation; impl Animation for SelfBuffAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/biped_large/stunned.rs b/voxygen/anim/src/biped_large/stunned.rs index 9ff3f40cab..9b44573229 100644 --- a/voxygen/anim/src/biped_large/stunned.rs +++ b/voxygen/anim/src/biped_large/stunned.rs @@ -11,7 +11,6 @@ use core::f32::consts::PI; pub struct StunnedAnimation; impl Animation for StunnedAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), Vec3, diff --git a/voxygen/anim/src/biped_large/summon.rs b/voxygen/anim/src/biped_large/summon.rs index f335e6c62e..64723743e2 100644 --- a/voxygen/anim/src/biped_large/summon.rs +++ b/voxygen/anim/src/biped_large/summon.rs @@ -11,7 +11,6 @@ use core::f32::consts::PI; pub struct SummonAnimation; impl Animation for SummonAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/biped_large/wield.rs b/voxygen/anim/src/biped_large/wield.rs index 8a335b03d9..e11f88561e 100644 --- a/voxygen/anim/src/biped_large/wield.rs +++ b/voxygen/anim/src/biped_large/wield.rs @@ -8,7 +8,6 @@ use core::{f32::consts::PI, ops::Mul}; pub struct WieldAnimation; impl Animation for WieldAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), (Option, Option<&'a AbilitySpec>), diff --git a/voxygen/anim/src/character/beam.rs b/voxygen/anim/src/character/beam.rs index bb4fda9f27..77039d91d3 100644 --- a/voxygen/anim/src/character/beam.rs +++ b/voxygen/anim/src/character/beam.rs @@ -11,7 +11,6 @@ use std::f32::consts::PI; pub struct BeamAnimation; impl Animation for BeamAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, (Option, Option), diff --git a/voxygen/anim/src/character/idle.rs b/voxygen/anim/src/character/idle.rs index 8d3c7728ea..68f12aefcc 100644 --- a/voxygen/anim/src/character/idle.rs +++ b/voxygen/anim/src/character/idle.rs @@ -9,7 +9,6 @@ use std::ops::Mul; pub struct IdleAnimation; impl Animation for IdleAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, Option, diff --git a/voxygen/anim/src/character/jump.rs b/voxygen/anim/src/character/jump.rs index a4ffb7397e..5e5a14e839 100644 --- a/voxygen/anim/src/character/jump.rs +++ b/voxygen/anim/src/character/jump.rs @@ -7,7 +7,6 @@ use core::f32::consts::PI; pub struct JumpAnimation; impl Animation for JumpAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, Option, diff --git a/voxygen/anim/src/character/mount.rs b/voxygen/anim/src/character/mount.rs index db18826172..f8275b40d3 100644 --- a/voxygen/anim/src/character/mount.rs +++ b/voxygen/anim/src/character/mount.rs @@ -8,7 +8,6 @@ use std::{f32::consts::PI, ops::Mul}; pub struct MountAnimation; impl Animation for MountAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, Option, diff --git a/voxygen/anim/src/character/repeater.rs b/voxygen/anim/src/character/repeater.rs index 74e7bac3ac..b99c4734fe 100644 --- a/voxygen/anim/src/character/repeater.rs +++ b/voxygen/anim/src/character/repeater.rs @@ -12,7 +12,6 @@ use core::f32::consts::PI; pub struct RepeaterAnimation; impl Animation for RepeaterAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, (Option, Option), diff --git a/voxygen/anim/src/character/shockwave.rs b/voxygen/anim/src/character/shockwave.rs index ab3f917928..6c7ef2dd9c 100644 --- a/voxygen/anim/src/character/shockwave.rs +++ b/voxygen/anim/src/character/shockwave.rs @@ -13,7 +13,6 @@ pub struct Input { pub struct ShockwaveAnimation; impl Animation for ShockwaveAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, (Option, Option), diff --git a/voxygen/anim/src/character/sneakwield.rs b/voxygen/anim/src/character/sneakwield.rs index a5435e4711..98be3fa8c2 100644 --- a/voxygen/anim/src/character/sneakwield.rs +++ b/voxygen/anim/src/character/sneakwield.rs @@ -8,7 +8,6 @@ use core::{f32::consts::PI, ops::Mul}; pub struct SneakWieldAnimation; impl Animation for SneakWieldAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, Option, diff --git a/voxygen/anim/src/character/stand.rs b/voxygen/anim/src/character/stand.rs index 7f7665c94c..7cb771fce0 100644 --- a/voxygen/anim/src/character/stand.rs +++ b/voxygen/anim/src/character/stand.rs @@ -9,7 +9,6 @@ use std::ops::Mul; pub struct StandAnimation; impl Animation for StandAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, Option, diff --git a/voxygen/anim/src/character/swimwield.rs b/voxygen/anim/src/character/swimwield.rs index 7edf40e562..3fcdbe4f25 100644 --- a/voxygen/anim/src/character/swimwield.rs +++ b/voxygen/anim/src/character/swimwield.rs @@ -8,7 +8,6 @@ use core::{f32::consts::PI, ops::Mul}; pub struct SwimWieldAnimation; impl Animation for SwimWieldAnimation { - #[allow(clippy::type_complexity)] type Dependency<'a> = ( Option, Option, diff --git a/voxygen/clippy.toml b/voxygen/clippy.toml deleted file mode 100644 index fee00d7951..0000000000 --- a/voxygen/clippy.toml +++ /dev/null @@ -1,2 +0,0 @@ -# Because 7 is just very low, it corresponds to a 6-argument method. -too-many-arguments-threshold = 10 diff --git a/voxygen/i18n/src/stats.rs b/voxygen/i18n/src/stats.rs index 534b3de8cc..bca6c71d40 100644 --- a/voxygen/i18n/src/stats.rs +++ b/voxygen/i18n/src/stats.rs @@ -14,7 +14,6 @@ pub(crate) struct LocalizationStats { pub(crate) errors: usize, } -#[allow(clippy::type_complexity)] pub(crate) struct LocalizationAnalysis { language_identifier: String, pub(crate) data: HashMap, Vec<(PathBuf, String, Option)>>, diff --git a/voxygen/src/ecs/sys/floater.rs b/voxygen/src/ecs/sys/floater.rs index 5fbcf4786e..4f6495df01 100644 --- a/voxygen/src/ecs/sys/floater.rs +++ b/voxygen/src/ecs/sys/floater.rs @@ -15,7 +15,6 @@ pub const HP_ACCUMULATETIME: f32 = 1.0; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, PlayerEntity>, diff --git a/voxygen/src/ecs/sys/interpolation.rs b/voxygen/src/ecs/sys/interpolation.rs index 7479dbd3e9..55b90c17a4 100644 --- a/voxygen/src/ecs/sys/interpolation.rs +++ b/voxygen/src/ecs/sys/interpolation.rs @@ -12,7 +12,6 @@ use vek::*; #[derive(Default)] pub struct Sys; impl<'a> System<'a> for Sys { - #[allow(clippy::type_complexity)] type SystemData = ( Entities<'a>, Read<'a, DeltaTime>, diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 8490f916a0..cdb925406a 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -583,7 +583,7 @@ pub struct Bag<'a> { } impl<'a> Bag<'a> { - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 + #[allow(clippy::too_many_arguments)] pub fn new( client: &'a Client, global_state: &'a GlobalState, diff --git a/voxygen/src/hud/buttons.rs b/voxygen/src/hud/buttons.rs index d91df8188c..133cd3f749 100644 --- a/voxygen/src/hud/buttons.rs +++ b/voxygen/src/hud/buttons.rs @@ -66,7 +66,6 @@ pub struct Buttons<'a> { } impl<'a> Buttons<'a> { - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 pub fn new( client: &'a Client, show_bag: bool, diff --git a/voxygen/src/hud/crafting.rs b/voxygen/src/hud/crafting.rs index 825a552ce8..6266690f1e 100644 --- a/voxygen/src/hud/crafting.rs +++ b/voxygen/src/hud/crafting.rs @@ -105,7 +105,7 @@ pub struct Crafting<'a> { tooltip_manager: &'a mut TooltipManager, show: &'a mut Show, } -#[allow(clippy::too_many_arguments)] + impl<'a> Crafting<'a> { pub fn new( client: &'a Client, diff --git a/voxygen/src/hud/group.rs b/voxygen/src/hud/group.rs index 3d44d302b6..cefc8c7b08 100644 --- a/voxygen/src/hud/group.rs +++ b/voxygen/src/hud/group.rs @@ -89,7 +89,6 @@ pub struct Group<'a> { } impl<'a> Group<'a> { - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 pub fn new( show: &'a mut Show, client: &'a Client, diff --git a/voxygen/src/hud/loot_scroller.rs b/voxygen/src/hud/loot_scroller.rs index 6676bd5026..a5212f61d2 100644 --- a/voxygen/src/hud/loot_scroller.rs +++ b/voxygen/src/hud/loot_scroller.rs @@ -65,7 +65,6 @@ pub struct LootScroller<'a> { common: widget::CommonBuilder, } impl<'a> LootScroller<'a> { - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 pub fn new( new_messages: &'a mut VecDeque, client: &'a Client, diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index 601e09934b..765205f3a2 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -114,7 +114,6 @@ pub struct Map<'a> { map_drag: Vec2, } impl<'a> Map<'a> { - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 pub fn new( show: &'a Show, client: &'a Client, diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index 780bc0f38f..411e4ae5b3 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -267,7 +267,7 @@ pub struct Skillbar<'a> { } impl<'a> Skillbar<'a> { - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 + #[allow(clippy::too_many_arguments)] pub fn new( client: &'a Client, global_state: &'a GlobalState, diff --git a/voxygen/src/lib.rs b/voxygen/src/lib.rs index e7ff518c3c..2c6c8d2196 100644 --- a/voxygen/src/lib.rs +++ b/voxygen/src/lib.rs @@ -1,6 +1,6 @@ #![deny(unsafe_code)] #![allow(incomplete_features)] -#![allow(clippy::option_map_unit_fn)] +#![allow(clippy::identity_op, clippy::option_map_unit_fn)] #![deny(clippy::clone_on_ref_ptr)] #![feature( array_methods, diff --git a/voxygen/src/menu/main/ui/login.rs b/voxygen/src/menu/main/ui/login.rs index 0ac08c54c0..a6a058e141 100644 --- a/voxygen/src/menu/main/ui/login.rs +++ b/voxygen/src/menu/main/ui/login.rs @@ -51,7 +51,6 @@ impl Screen { } } - #[allow(clippy::too_many_arguments)] pub(super) fn view( &mut self, fonts: &Fonts, diff --git a/voxygen/src/render/mesh.rs b/voxygen/src/render/mesh.rs index b34eeebb5b..b673ec01f2 100644 --- a/voxygen/src/render/mesh.rs +++ b/voxygen/src/render/mesh.rs @@ -15,8 +15,8 @@ impl Clone for Mesh { } impl Mesh { + #[allow(clippy::new_without_default)] /// Create a new `Mesh`. - #[allow(clippy::new_without_default)] // TODO: Pending review in #587 pub fn new() -> Self { Self { verts: Vec::new() } } /// Clear vertices, allows reusing allocated memory of the underlying Vec. diff --git a/voxygen/src/render/pipelines/fluid.rs b/voxygen/src/render/pipelines/fluid.rs index 1c33af7c32..e4250413d8 100644 --- a/voxygen/src/render/pipelines/fluid.rs +++ b/voxygen/src/render/pipelines/fluid.rs @@ -10,7 +10,6 @@ pub struct Vertex { } impl Vertex { - #[allow(clippy::identity_op)] // TODO: Pending review in #587 pub fn new(pos: Vec3, norm: Vec3) -> Self { let (norm_axis, norm_dir) = norm .as_slice() diff --git a/voxygen/src/render/pipelines/mod.rs b/voxygen/src/render/pipelines/mod.rs index 347a83d886..fac31813dc 100644 --- a/voxygen/src/render/pipelines/mod.rs +++ b/voxygen/src/render/pipelines/mod.rs @@ -81,7 +81,7 @@ pub struct Shadow { impl Globals { /// Create global consts from the provided parameters. - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 + #[allow(clippy::too_many_arguments)] pub fn new( view_mat: Mat4, proj_mat: Mat4, diff --git a/voxygen/src/render/pipelines/terrain.rs b/voxygen/src/render/pipelines/terrain.rs index 082abdbaad..920e1c8c8b 100644 --- a/voxygen/src/render/pipelines/terrain.rs +++ b/voxygen/src/render/pipelines/terrain.rs @@ -11,7 +11,6 @@ pub struct Vertex { } impl Vertex { - #[allow(clippy::identity_op)] // TODO: Pending review in #587 /// NOTE: meta is true when the terrain vertex is touching water. pub fn new(atlas_pos: Vec2, pos: Vec3, norm: Vec3, meta: bool) -> Self { const EXTRA_NEG_Z: f32 = 32768.0; @@ -97,7 +96,6 @@ impl Vertex { ] } - #[allow(clippy::identity_op)] pub fn make_col_light_figure( // 0 to 31 light: u8, diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index 719ac4a5f4..c07ccb4439 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -98,7 +98,6 @@ struct Shadow { /// 1. Only interface pipelines created /// 2. All of the pipelines have been created #[allow(clippy::large_enum_variant)] // They are both pretty large -#[allow(clippy::type_complexity)] enum State { // NOTE: this is used as a transient placeholder for moving things out of State temporarily Nothing, diff --git a/voxygen/src/render/renderer/pipeline_creation.rs b/voxygen/src/render/renderer/pipeline_creation.rs index 8b5a3feaf7..f28834a1fa 100644 --- a/voxygen/src/render/renderer/pipeline_creation.rs +++ b/voxygen/src/render/renderer/pipeline_creation.rs @@ -818,7 +818,6 @@ pub(super) fn initial_create_pipelines( /// Use this to recreate all the pipelines in the background. /// TODO: report progress /// NOTE: this tries to use all the CPU cores to complete as soon as possible -#[allow(clippy::type_complexity)] pub(super) fn recreate_pipelines( device: Arc, immutable_layouts: Arc, diff --git a/voxygen/src/scene/debug.rs b/voxygen/src/scene/debug.rs index 747e80c364..c177fec6dd 100644 --- a/voxygen/src/scene/debug.rs +++ b/voxygen/src/scene/debug.rs @@ -151,7 +151,6 @@ pub struct DebugShapeId(pub u64); pub struct Debug { next_shape_id: DebugShapeId, pending_shapes: HashMap, - #[allow(clippy::type_complexity)] pending_locals: HashMap, pending_deletes: HashSet, models: HashMap, Bound>)>, diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index fd3f36aaf5..84b441f5be 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -280,7 +280,6 @@ impl CharacterCacheKey { } } -#[allow(clippy::type_complexity)] // TODO: Pending review in #587 pub struct FigureModelCache where Skel: Skeleton, @@ -295,7 +294,7 @@ impl FigureModelCache where Skel::Body: BodySpec + Eq + Hash, { - #[allow(clippy::new_without_default)] // TODO: Pending review in #587 + #[allow(clippy::new_without_default)] pub fn new() -> Self { // NOTE: It might be better to bubble this error up rather than panicking. let manifests = ::load_spec().unwrap(); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index c749ea2aa2..99154039a4 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -5407,7 +5407,6 @@ impl FigureMgr { } } - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 fn get_model_for_render( &self, tick: u64, diff --git a/voxygen/src/session/target.rs b/voxygen/src/session/target.rs index 1d8d0f1400..d19d990f28 100644 --- a/voxygen/src/session/target.rs +++ b/voxygen/src/session/target.rs @@ -44,7 +44,6 @@ impl Target { pub const MAX_TARGET_RANGE: f32 = 300.0; /// Calculate what the cursor is pointing at within the 3d scene -#[allow(clippy::type_complexity)] pub(super) fn targets_under_cursor( client: &Client, cam_pos: Vec3, diff --git a/voxygen/src/ui/graphic/mod.rs b/voxygen/src/ui/graphic/mod.rs index 969e99fdd4..b92cd96352 100644 --- a/voxygen/src/ui/graphic/mod.rs +++ b/voxygen/src/ui/graphic/mod.rs @@ -149,7 +149,6 @@ pub struct GraphicCache { // Stores the location of graphics rendered at a particular resolution and cached on the cpu cache_map: HashMap, - #[allow(clippy::type_complexity)] keyed_jobs: KeyedJobs<(Id, Vec2), Option<(RgbaImage, Option>)>>, } impl GraphicCache { @@ -405,7 +404,6 @@ impl GraphicCache { } // Draw a graphic at the specified dimensions -#[allow(clippy::type_complexity)] fn draw_graphic( graphic_map: &GraphicMap, graphic_id: Id, diff --git a/voxygen/src/ui/widgets/slot.rs b/voxygen/src/ui/widgets/slot.rs index a8a2898663..3975bc1a62 100644 --- a/voxygen/src/ui/widgets/slot.rs +++ b/voxygen/src/ui/widgets/slot.rs @@ -524,7 +524,6 @@ where self } - #[allow(clippy::too_many_arguments)] // TODO: Pending review in #587 fn new( slot_key: K, empty_slot: image::Id, diff --git a/world/examples/chunk_compression_benchmarks.rs b/world/examples/chunk_compression_benchmarks.rs index 28e37d0c16..f4cb5fbf4e 100644 --- a/world/examples/chunk_compression_benchmarks.rs +++ b/world/examples/chunk_compression_benchmarks.rs @@ -747,8 +747,7 @@ fn main() { let mut total_timings: BTreeMap<&str, f32> = BTreeMap::new(); let mut count = 0; let mut volgrid = VolGrid2d::new().unwrap(); - for (i, spiralpos) in Spiral2d::new() - .radius(RADIUS) + for (i, spiralpos) in Spiral2d::with_radius(RADIUS) .map(|v| v + sitepos.as_()) .enumerate() { diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 5f2ae832ca..4e62b5297e 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -186,7 +186,6 @@ impl<'a> BlockGen<'a> { .or_else(|| { // Rocks if (height + 2.5 - wposf.z as f32).div(7.5).abs().powi(2) < rock { - #[allow(clippy::identity_op)] let field0 = RandomField::new(world.seed + 0); let field1 = RandomField::new(world.seed + 1); let field2 = RandomField::new(world.seed + 2); diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 47b03e2045..2961509b98 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -39,7 +39,6 @@ pub struct CaveInfo { pub name: String, } -#[allow(clippy::type_complexity)] // TODO: Pending review in #587 #[derive(Default)] pub struct Civs { pub civs: Store, diff --git a/world/src/index.rs b/world/src/index.rs index 75eaa6d7f2..35ea35d1be 100644 --- a/world/src/index.rs +++ b/world/src/index.rs @@ -139,7 +139,6 @@ pub struct Noise { } impl Noise { - #[allow(clippy::identity_op)] fn new(seed: u32) -> Self { Self { cave_nz: SuperSimplex::new().set_seed(seed + 0), diff --git a/world/src/layer/scatter.rs b/world/src/layer/scatter.rs index e346c53a39..064f84140d 100644 --- a/world/src/layer/scatter.rs +++ b/world/src/layer/scatter.rs @@ -21,7 +21,6 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) { use WaterMode::*; use SpriteKind::*; - #[allow(clippy::type_complexity)] // TODO: Add back all sprites we had before let scatter: &[( _, diff --git a/world/src/lib.rs b/world/src/lib.rs index 9d993d4467..c46d838f94 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -3,7 +3,7 @@ #![allow( clippy::option_map_unit_fn, clippy::blocks_in_if_conditions, - clippy::too_many_arguments + clippy::identity_op )] #![allow(clippy::branches_sharing_code)] // TODO: evaluate #![deny(clippy::clone_on_ref_ptr)] diff --git a/world/src/sim/erosion.rs b/world/src/sim/erosion.rs index 8db97ba66a..6b533f5e9d 100644 --- a/world/src/sim/erosion.rs +++ b/world/src/sim/erosion.rs @@ -697,6 +697,7 @@ impl m32 { /// Prediction in Geomorphology, Geophysical Monograph 135. /// Copyright 2003 by the American Geophysical Union /// 10.1029/135GM09 +#[allow(clippy::too_many_arguments)] fn erode( // Underlying map dimensions. map_size_lg: MapSizeLg, @@ -2339,7 +2340,6 @@ pub fn mrec_downhill( /// * A bitmask representing which neighbors are downhill. /// * Stack order for multiple receivers (from top to bottom). /// * The weight for each receiver, for each node. -#[allow(clippy::type_complexity)] // TODO: Pending review in #587 pub fn get_multi_rec>( map_size_lg: MapSizeLg, h: impl Fn(usize) -> F + Sync, @@ -2531,6 +2531,7 @@ pub fn get_multi_rec>( } /// Perform erosion n times. +#[allow(clippy::too_many_arguments)] pub fn do_erosion( map_size_lg: MapSizeLg, _max_uplift: f32, diff --git a/world/src/site/settlement/mod.rs b/world/src/site/settlement/mod.rs index 5a74e10afb..5a89a888e6 100644 --- a/world/src/site/settlement/mod.rs +++ b/world/src/site/settlement/mod.rs @@ -558,7 +558,6 @@ impl Settlement { } } - #[allow(clippy::identity_op)] // TODO: Pending review in #587 pub fn apply_to<'a>( &'a self, index: IndexRef, diff --git a/world/src/site2/plot/castle.rs b/world/src/site2/plot/castle.rs index 2a6e200645..dca21d2916 100644 --- a/world/src/site2/plot/castle.rs +++ b/world/src/site2/plot/castle.rs @@ -42,7 +42,6 @@ impl Castle { } impl Structure for Castle { - #[allow(clippy::identity_op)] fn render(&self, site: &Site, _land: &Land, painter: &Painter) { let wall_height = 24; let parapet_height = 2; diff --git a/world/src/util/structure.rs b/world/src/util/structure.rs index 079424083d..48429f3e65 100644 --- a/world/src/util/structure.rs +++ b/world/src/util/structure.rs @@ -13,7 +13,6 @@ pub struct StructureGen2d { pub type StructureField = (Vec2, u32); impl StructureGen2d { - #[allow(clippy::identity_op)] // TODO: Pending review in #587 pub fn new(seed: u32, freq: u32, spread: u32) -> Self { Self { freq,