mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'xvar/clippy-globally-suppress-option_map_unit_fn' into 'master'
Globally suppressed clippy lint option_map_unit_fn for #587 See merge request veloren/veloren!1071
This commit is contained in:
commit
26e53409d8
@ -1,4 +1,5 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
|
||||
use client::{Client, Event};
|
||||
use common::{clock::Clock, comp};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
#![feature(label_break_value)]
|
||||
|
||||
pub mod cmd;
|
||||
|
@ -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<I: Iterator<Item = Item>>(&mut self, mut items: I) -> Result<(), Error> {
|
||||
let mut leftovers = Vec::new();
|
||||
for item in &mut items {
|
||||
|
@ -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,
|
||||
|
@ -1,4 +1,5 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
#![type_length_limit = "1664759"]
|
||||
#![feature(
|
||||
arbitrary_enum_discriminant,
|
||||
|
@ -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,
|
||||
(
|
||||
|
@ -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)]
|
||||
|
@ -1,4 +1,5 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
|
||||
use common::clock::Clock;
|
||||
use log::info;
|
||||
|
@ -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,
|
||||
|
@ -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<f32>)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587
|
||||
pub fn handle_respawn(server: &Server, entity: EcsEntity) {
|
||||
let state = &server.state;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -1,4 +1,5 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
#![feature(drain_filter)]
|
||||
|
||||
pub mod auth_provider;
|
||||
|
@ -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) => {
|
||||
|
@ -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(
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
@ -1,4 +1,5 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
#![feature(drain_filter, bool_to_option)]
|
||||
#![recursion_limit = "2048"]
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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<impl Rng>) {
|
||||
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<i32>],
|
||||
|
Loading…
Reference in New Issue
Block a user