mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'Resolve-unused-clippy-supressions' into 'master'
Resolve unused clippy supressions See merge request veloren/veloren!2673
This commit is contained in:
commit
37077b5703
@ -1,5 +1,4 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
#![deny(clippy::clone_on_ref_ptr)]
|
||||
|
||||
use common::{clock::Clock, comp};
|
||||
|
@ -1833,7 +1833,6 @@ impl Client {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn handle_server_in_game_msg(
|
||||
&mut self,
|
||||
frontend_events: &mut Vec<Event>,
|
||||
@ -2012,7 +2011,6 @@ impl Client {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn handle_server_terrain_msg(&mut self, msg: ServerGeneral) -> Result<(), Error> {
|
||||
prof_span!("handle_server_terrain_mgs");
|
||||
match msg {
|
||||
@ -2034,7 +2032,6 @@ impl Client {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn handle_server_character_screen_msg(
|
||||
&mut self,
|
||||
events: &mut Vec<Event>,
|
||||
|
@ -261,7 +261,6 @@ pub fn handle_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f3
|
||||
}
|
||||
|
||||
/// Updates components to move player as if theyre on ground or in air
|
||||
#[allow(clippy::assign_op_pattern)] // TODO: Pending review in #587
|
||||
fn basic_move(data: &JoinData<'_>, update: &mut StateUpdate, efficiency: f32) {
|
||||
let efficiency = efficiency * data.stats.move_speed_modifier * data.stats.friction_modifier;
|
||||
|
||||
|
@ -147,7 +147,7 @@ impl MapSizeLg {
|
||||
// not technically been stabilized yet, Clippy probably doesn't check for this
|
||||
// case yet. When it can, or when is_some() is stabilized as a `const fn`,
|
||||
// we should deal with this.
|
||||
#[allow(clippy::redundant_pattern_matching, clippy::result_unit_err)]
|
||||
#[allow(clippy::result_unit_err)]
|
||||
/// Construct a new `MapSizeLg`, returning an error if the needed invariants
|
||||
/// do not hold and the vector otherwise.
|
||||
///
|
||||
|
@ -177,7 +177,6 @@ pub fn from_i64(i: i64) -> u64 { u64::from_le_bytes(i.to_le_bytes()) }
|
||||
|
||||
// This function is not public because this function should not be used without
|
||||
// an interface to limit unsafe behaviours
|
||||
#[allow(clippy::needless_range_loop)]
|
||||
fn execute_raw(
|
||||
module: &PluginModule,
|
||||
instance: &mut Instance,
|
||||
|
@ -97,7 +97,6 @@ impl<'a> System<'a> for Sys {
|
||||
const ORIGIN: Origin = Origin::Common;
|
||||
const PHASE: Phase = Phase::Create;
|
||||
|
||||
#[allow(clippy::while_let_on_iterator)] // TODO: Pending review in #587
|
||||
fn run(
|
||||
_job: &mut Job<Self>,
|
||||
(
|
||||
|
@ -118,7 +118,6 @@ impl Server {
|
||||
trace!("Stop connect_manager");
|
||||
}
|
||||
|
||||
#[allow(clippy::eval_order_dependence)]
|
||||
async fn loop_participant(&self, p: Participant) {
|
||||
if let (Ok(cmd_out), Ok(file_out), Ok(cmd_in), Ok(file_in)) = (
|
||||
p.open(3, Promises::ORDERED | Promises::CONSISTENCY, 0)
|
||||
|
@ -30,7 +30,6 @@ pub fn event_handler(_args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
|
||||
let out: proc_macro2::TokenStream = if fn_args.len() == 1 {
|
||||
quote! {
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
#[no_mangle]
|
||||
pub fn #fn_name(intern__ptr: i64, intern__len: i64) -> i64 {
|
||||
let input = ::veloren_plugin_rt::read_input(intern__ptr as _,intern__len as _).unwrap();
|
||||
@ -47,7 +46,6 @@ pub fn event_handler(_args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
}
|
||||
} else {
|
||||
quote! {
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
#[no_mangle]
|
||||
pub fn #fn_name(intern__ptr: i64, intern__len: i64) -> i64 {
|
||||
let input = ::veloren_plugin_rt::read_input(intern__ptr as _,intern__len as _).unwrap();
|
||||
|
@ -32,7 +32,6 @@ lazy_static::lazy_static! {
|
||||
}
|
||||
const TPS: u64 = 30;
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn main() -> io::Result<()> {
|
||||
let app = ArgvApp::from_args();
|
||||
|
||||
|
@ -38,7 +38,6 @@ pub fn snuff_lantern(storage: &mut WriteStorage<comp::LightEmitter>, entity: Ecs
|
||||
}
|
||||
|
||||
#[allow(clippy::blocks_in_if_conditions)]
|
||||
#[allow(clippy::same_item_push)] // TODO: Pending review in #587
|
||||
pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::InventoryManip) {
|
||||
let state = server.state_mut();
|
||||
|
||||
@ -772,7 +771,6 @@ mod tests {
|
||||
use super::*;
|
||||
|
||||
// Helper function
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn test_cylinder(pos: comp::Pos) -> Option<Cylinder> {
|
||||
Some(Cylinder::from_components(pos.0, None, None, None))
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ use tracing::{debug, error, warn};
|
||||
|
||||
impl Sys {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn handle_general_msg(
|
||||
server_emitter: &mut common::event::Emitter<'_, ServerEvent>,
|
||||
entity: specs::Entity,
|
||||
|
@ -1,5 +1,4 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::option_map_unit_fn)]
|
||||
#![feature(bool_to_option)]
|
||||
#![recursion_limit = "2048"]
|
||||
|
||||
@ -22,7 +21,6 @@ use tracing::{error, info, warn};
|
||||
#[cfg(feature = "egui-ui")]
|
||||
use veloren_voxygen::ui::egui::EguiState;
|
||||
|
||||
#[allow(clippy::manual_unwrap_or)]
|
||||
fn main() {
|
||||
let userdata_dir = common_base::userdata_dir_workspace!();
|
||||
|
||||
|
@ -224,10 +224,8 @@ fn calc_light<V: RectRasterableVol<Vox = Block> + ReadVol + Debug>(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::collapsible_if)]
|
||||
#[allow(clippy::many_single_char_names)]
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[allow(clippy::needless_range_loop)] // TODO: Pending review in #587
|
||||
pub fn generate_mesh<'a, V: RectRasterableVol<Vox = Block> + ReadVol + Debug + 'static>(
|
||||
vol: &'a VolGrid2d<V>,
|
||||
(range, max_texture_size, _boi): (Aabb<i32>, Vec2<u16>, &'a BlocksOfInterest),
|
||||
|
@ -5226,7 +5226,6 @@ impl FigureColLights {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
fn make_atlas(renderer: &mut Renderer) -> Result<AtlasAllocator, RenderError> {
|
||||
let max_texture_size = renderer.max_texture_size();
|
||||
let atlas_size = guillotiere::Size::new(max_texture_size as i32, max_texture_size as i32);
|
||||
|
@ -918,7 +918,6 @@ impl ParticleMgr {
|
||||
.join()
|
||||
{
|
||||
for (_, aura) in auras.auras.iter() {
|
||||
#[allow(clippy::single_match)]
|
||||
match aura.aura_kind {
|
||||
aura::AuraKind::Buff {
|
||||
kind: buff::BuffKind::ProtectingWard,
|
||||
@ -1045,7 +1044,6 @@ impl ParticleMgr {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::same_item_push)] // TODO: Pending review in #587
|
||||
fn maintain_block_particles(
|
||||
&mut self,
|
||||
scene_data: &SceneData,
|
||||
|
@ -262,7 +262,6 @@ pub fn spawn_manifest() -> Vec<(&'static str, DensityFn)> {
|
||||
]
|
||||
}
|
||||
|
||||
#[allow(clippy::eval_order_dependence)]
|
||||
pub fn apply_wildlife_supplement<'a, R: Rng>(
|
||||
// NOTE: Used only for dynamic elements like chests and entities!
|
||||
dynamic_rng: &mut R,
|
||||
|
@ -206,7 +206,6 @@ impl World {
|
||||
tc.find_accessible_pos(spawn_wpos, ascending)
|
||||
}
|
||||
|
||||
#[allow(clippy::eval_order_dependence)]
|
||||
#[allow(clippy::result_unit_err)]
|
||||
pub fn generate_chunk(
|
||||
&self,
|
||||
|
Loading…
Reference in New Issue
Block a user