diff --git a/chat-cli/src/main.rs b/chat-cli/src/main.rs index bd01bcfc71..e982be403e 100644 --- a/chat-cli/src/main.rs +++ b/chat-cli/src/main.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] use client::{Client, Event}; use common::{clock::Clock, comp}; diff --git a/client/src/lib.rs b/client/src/lib.rs index a524b4aeca..a718d774d4 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] #![feature(label_break_value)] pub mod cmd; diff --git a/common/src/comp/inventory/mod.rs b/common/src/comp/inventory/mod.rs index a74992592b..4a5fd63322 100644 --- a/common/src/comp/inventory/mod.rs +++ b/common/src/comp/inventory/mod.rs @@ -181,7 +181,6 @@ impl Inventory { /// the proper structure wouldn't need to iterate at all, but because /// this should be fairly cold code, clarity has been favored over /// efficiency. - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn push_all_unique>(&mut self, mut items: I) -> Result<(), Error> { let mut leftovers = Vec::new(); for item in &mut items { diff --git a/common/src/comp/inventory/slot.rs b/common/src/comp/inventory/slot.rs index a15b842820..6aca20f5bb 100644 --- a/common/src/comp/inventory/slot.rs +++ b/common/src/comp/inventory/slot.rs @@ -193,7 +193,6 @@ fn swap_loadout(slot_a: EquipSlot, slot_b: EquipSlot, loadout: &mut Loadout) { // Should this report if a change actually occurred? (might be useful when // minimizing network use) -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn swap( slot_a: Slot, slot_b: Slot, diff --git a/common/src/lib.rs b/common/src/lib.rs index 85db925e03..99f9020b76 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] #![type_length_limit = "1664759"] #![feature( arbitrary_enum_discriminant, diff --git a/common/src/sys/mount.rs b/common/src/sys/mount.rs index 864a2593d7..e40a77be0b 100644 --- a/common/src/sys/mount.rs +++ b/common/src/sys/mount.rs @@ -23,7 +23,6 @@ impl<'a> System<'a> for Sys { WriteStorage<'a, Ori>, ); - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 fn run( &mut self, ( diff --git a/network/src/lib.rs b/network/src/lib.rs index 36568f2dc7..b3f56791df 100644 --- a/network/src/lib.rs +++ b/network/src/lib.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] #![cfg_attr(test, deny(rust_2018_idioms))] #![cfg_attr(test, deny(warnings))] #![feature(try_trait, const_if_match)] diff --git a/server-cli/src/main.rs b/server-cli/src/main.rs index 00dd2e1d67..5b5c9af5f9 100644 --- a/server-cli/src/main.rs +++ b/server-cli/src/main.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] use common::clock::Clock; use log::info; diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 500c0dff70..3fdf6cd6aa 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -93,7 +93,6 @@ fn get_handler(cmd: &ChatCommand) -> CommandHandler { } #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 fn handle_give_item( server: &mut Server, client: EcsEntity, @@ -224,7 +223,6 @@ fn handle_goto( } } -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 fn handle_kill( server: &mut Server, client: EcsEntity, diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index bcbeb93a2b..cdc8527f93 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -24,7 +24,6 @@ pub fn handle_damage(server: &Server, uid: Uid, change: HealthChange) { } } -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSource) { let state = server.state_mut(); @@ -332,7 +331,6 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3) } } -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn handle_respawn(server: &Server, entity: EcsEntity) { let state = &server.state; diff --git a/server/src/events/interaction.rs b/server/src/events/interaction.rs index 45ccbd43b0..b07c68bed4 100644 --- a/server/src/events/interaction.rs +++ b/server/src/events/interaction.rs @@ -81,7 +81,6 @@ pub fn handle_mount(server: &mut Server, mounter: EcsEntity, mountee: EcsEntity) } } -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn handle_unmount(server: &mut Server, mounter: EcsEntity) { let state = server.state_mut(); let mountee_entity = state @@ -100,7 +99,6 @@ pub fn handle_unmount(server: &mut Server, mounter: EcsEntity) { } #[allow(clippy::nonminimal_bool)] // TODO: Pending review in #587 -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn handle_possess(server: &Server, possessor_uid: Uid, possesse_uid: Uid) { let state = &server.state; let ecs = state.ecs(); diff --git a/server/src/lib.rs b/server/src/lib.rs index 8f712db850..eb74ac30b4 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] #![feature(drain_filter)] pub mod auth_provider; diff --git a/server/src/state_ext.rs b/server/src/state_ext.rs index 4a80c8bbab..06c3645cf0 100644 --- a/server/src/state_ext.rs +++ b/server/src/state_ext.rs @@ -65,7 +65,6 @@ impl StateExt for State { success } - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 fn apply_effect(&mut self, entity: EcsEntity, effect: Effect) { match effect { Effect::Health(change) => { diff --git a/server/src/sys/message.rs b/server/src/sys/message.rs index 2e9ec79338..676b768fbd 100644 --- a/server/src/sys/message.rs +++ b/server/src/sys/message.rs @@ -51,7 +51,6 @@ impl<'a> System<'a> for Sys { ); #[allow(clippy::match_ref_pats)] // TODO: Pending review in #587 - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 #[allow(clippy::single_char_pattern)] // TODO: Pending review in #587 #[allow(clippy::single_match)] // TODO: Pending review in #587 fn run( diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs index 5ec309e46c..27acbd7a0f 100644 --- a/server/src/sys/sentinel.rs +++ b/server/src/sys/sentinel.rs @@ -57,7 +57,6 @@ pub struct TrackedComps<'a> { pub speech_bubble: ReadStorage<'a, SpeechBubble>, } impl<'a> TrackedComps<'a> { - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn create_entity_package( &self, entity: EcsEntity, diff --git a/voxygen/src/ecs/sys/floater.rs b/voxygen/src/ecs/sys/floater.rs index 08b71f2eeb..c44afe1275 100644 --- a/voxygen/src/ecs/sys/floater.rs +++ b/voxygen/src/ecs/sys/floater.rs @@ -29,7 +29,6 @@ impl<'a> System<'a> for Sys { ); #[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587 - #[allow(clippy::option_map_unit_fn)] // 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/ecs/sys/interpolation.rs b/voxygen/src/ecs/sys/interpolation.rs index edbc54e6c9..fa48e15504 100644 --- a/voxygen/src/ecs/sys/interpolation.rs +++ b/voxygen/src/ecs/sys/interpolation.rs @@ -21,7 +21,6 @@ impl<'a> System<'a> for Sys { WriteStorage<'a, Interpolated>, ); - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 fn run( &mut self, (entities, dt, positions, orientations, velocities, mut interpolated): Self::SystemData, diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index a56a4feb3f..444df2a3c0 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -554,7 +554,6 @@ impl Hud { } #[allow(clippy::assign_op_pattern)] // TODO: Pending review in #587 - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 #[allow(clippy::single_match)] // TODO: Pending review in #587 fn update_layout( &mut self, @@ -1909,7 +1908,6 @@ impl Hud { } } - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn handle_event(&mut self, event: WinEvent, global_state: &mut GlobalState) -> bool { // Helper fn handle_slot( diff --git a/voxygen/src/lib.rs b/voxygen/src/lib.rs index f57bfdc35e..f0a9f34124 100644 --- a/voxygen/src/lib.rs +++ b/voxygen/src/lib.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] #![feature(drain_filter, bool_to_option)] #![recursion_limit = "2048"] diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 0449595504..dcfc6d4407 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![allow(clippy::option_map_unit_fn)] #![feature(bool_to_option)] #![recursion_limit = "2048"] @@ -16,7 +17,6 @@ use common::assets::{load, load_expect}; use log::{debug, error}; use std::{mem, panic, str::FromStr}; -#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 fn main() { #[cfg(feature = "tweak")] const_tweaker::run().expect("Could not run server"); diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index cd11aeaaad..3d7b3d2c58 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -28,7 +28,6 @@ impl MainMenuState { const DEFAULT_PORT: u16 = 14004; impl PlayState for MainMenuState { - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 #[allow(clippy::useless_format)] // TODO: Pending review in #587 fn play(&mut self, _: Direction, global_state: &mut GlobalState) -> PlayStateResult { // Set up an fps clock. diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index ca526ef84f..7127edb555 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -172,7 +172,6 @@ impl FigureMgr { } } - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 #[allow(clippy::or_fun_call)] // TODO: Pending review in #587 pub fn maintain(&mut self, renderer: &mut Renderer, scene_data: &SceneData, camera: &Camera) { let state = scene_data.state; diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index b1458f1659..d682bb5a85 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -70,7 +70,6 @@ impl<'a, R: Rng> GenCtx<'a, R> { impl Civs { #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 - #[allow(clippy::option_map_unit_fn)] // 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)); diff --git a/world/src/lib.rs b/world/src/lib.rs index 3854b1c2e6..f23feeb106 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -1,5 +1,6 @@ #![deny(unsafe_code)] #![allow(incomplete_features)] +#![allow(clippy::option_map_unit_fn)] #![feature(arbitrary_enum_discriminant, const_generics, label_break_value)] mod all; diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 8ed0b14881..08d26d4965 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -1327,7 +1327,6 @@ impl WorldSim { /// Prepare the world for simulation #[allow(clippy::identity_conversion)] // TODO: Pending review in #587 - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn seed_elements(&mut self) { let mut rng = self.rng.clone(); diff --git a/world/src/site/settlement/mod.rs b/world/src/site/settlement/mod.rs index 0ec91ef30d..b45a48c1f7 100644 --- a/world/src/site/settlement/mod.rs +++ b/world/src/site/settlement/mod.rs @@ -249,7 +249,6 @@ impl Settlement { } } - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 pub fn place_town(&mut self, ctx: &mut GenCtx) { const PLOT_COUNT: usize = 3; @@ -1166,7 +1165,6 @@ impl Land { closed.into_iter().chain(open.into_iter()).collect() } - #[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587 fn write_path( &mut self, tiles: &[Vec2],