mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Suppressed all existing clippy warnings in preparation for fixes as part of #587
This commit is contained in:
parent
de849adf84
commit
950c62efc6
@ -14,7 +14,7 @@ code-quality:
|
||||
- veloren-docker
|
||||
script:
|
||||
- ln -s /dockercache/cache-all target
|
||||
- cargo clippy -- --warn clippy::all
|
||||
- cargo clippy -- -D warnings
|
||||
- cargo fmt --all -- --check
|
||||
|
||||
security:
|
||||
|
@ -78,6 +78,8 @@ fn nth_word(line: &str, n: usize) -> Option<usize> {
|
||||
None
|
||||
}
|
||||
|
||||
#[allow(clippy::chars_next_cmp)] // TODO: Pending review in #587
|
||||
#[allow(clippy::collapsible_if)] // TODO: Pending review in #587
|
||||
pub fn complete(line: &str, client: &Client) -> Vec<String> {
|
||||
let word = if line.chars().last().map_or(true, char::is_whitespace) {
|
||||
""
|
||||
|
@ -99,6 +99,8 @@ pub struct CharacterList {
|
||||
|
||||
impl Client {
|
||||
/// Create a new `Client`.
|
||||
#[allow(clippy::cmp_owned)] // TODO: Pending review in #587
|
||||
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
|
||||
pub fn new<A: Into<SocketAddr>>(addr: A, view_distance: Option<u32>) -> Result<Self, Error> {
|
||||
let client_state = ClientState::Connected;
|
||||
let mut postbox = PostBox::to(addr)?;
|
||||
@ -480,6 +482,7 @@ impl Client {
|
||||
|
||||
/// Execute a single client tick, handle input and update the game state by
|
||||
/// the given duration.
|
||||
#[allow(clippy::manual_saturating_arithmetic)] // TODO: Pending review in #587
|
||||
pub fn tick(
|
||||
&mut self,
|
||||
inputs: ControllerInputs,
|
||||
@ -699,6 +702,7 @@ impl Client {
|
||||
}
|
||||
|
||||
/// Handle new server messages.
|
||||
#[allow(clippy::collapsible_if)] // TODO: Pending review in #587
|
||||
fn handle_new_messages(&mut self) -> Result<Vec<Event>, Error> {
|
||||
let mut frontend_events = Vec::new();
|
||||
|
||||
|
@ -305,7 +305,7 @@ lazy_static! {
|
||||
}
|
||||
|
||||
if let Ok(result) = std::env::var("XDG_DATA_DIRS") {
|
||||
result.split(":").for_each(|x| paths.push(format!("{}/veloren/assets", x).into()));
|
||||
result.split(':').for_each(|x| paths.push(format!("{}/veloren/assets", x).into()));
|
||||
} else {
|
||||
// Fallback
|
||||
let fallback_paths = vec!["/usr/local/share", "/usr/share"];
|
||||
|
@ -104,6 +104,9 @@ impl Watcher {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::drop_copy)] // TODO: Pending review in #587
|
||||
#[allow(clippy::single_match)] // TODO: Pending review in #587
|
||||
#[allow(clippy::zero_ptr)] // TODO: Pending review in #587
|
||||
fn run(mut self) -> Sender<(PathBuf, Handler, Weak<AtomicBool>)> {
|
||||
let (watch_tx, watch_rx) = unbounded();
|
||||
|
||||
@ -136,6 +139,7 @@ pub struct ReloadIndicator {
|
||||
paths: Vec<PathBuf>,
|
||||
}
|
||||
impl ReloadIndicator {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
reloaded: Arc::new(AtomicBool::new(false)),
|
||||
|
@ -24,6 +24,7 @@ pub enum Error {
|
||||
Full(Vec<Item>),
|
||||
}
|
||||
|
||||
#[allow(clippy::len_without_is_empty)] // TODO: Pending review in #587
|
||||
impl Inventory {
|
||||
pub fn slots(&self) -> &[Option<Item>] { &self.slots }
|
||||
|
||||
@ -180,6 +181,7 @@ 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 {
|
||||
|
@ -139,6 +139,7 @@ pub fn loadout_remove(equip_slot: EquipSlot, loadout: &mut Loadout) -> Option<it
|
||||
loadout_replace(equip_slot, None, loadout)
|
||||
}
|
||||
|
||||
#[allow(clippy::redundant_closure)] // TODO: Pending review in #587
|
||||
fn swap_inventory_loadout(
|
||||
inventory_slot: usize,
|
||||
equip_slot: EquipSlot,
|
||||
@ -195,6 +196,7 @@ 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,
|
||||
|
@ -59,6 +59,7 @@ pub enum LocalEvent {
|
||||
Boost { entity: EcsEntity, vel: Vec3<f32> },
|
||||
}
|
||||
|
||||
#[allow(clippy::large_enum_variant)] // TODO: Pending review in #587
|
||||
pub enum ServerEvent {
|
||||
Explosion {
|
||||
pos: Vec3<f32>,
|
||||
|
@ -73,6 +73,7 @@ impl Segment {
|
||||
pub struct DynaUnionizer<V: Vox>(Vec<(Dyna<V, ()>, Vec3<i32>)>);
|
||||
|
||||
impl<V: Vox + Copy> DynaUnionizer<V> {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self { DynaUnionizer(Vec::new()) }
|
||||
|
||||
pub fn add(mut self, dyna: Dyna<V, ()>, offset: Vec3<i32>) -> Self {
|
||||
@ -87,6 +88,7 @@ impl<V: Vox + Copy> DynaUnionizer<V> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::neg_multiply)] // TODO: Pending review in #587
|
||||
pub fn unify(self) -> (Dyna<V, ()>, Vec3<i32>) {
|
||||
if self.0.is_empty() {
|
||||
return (Dyna::filled(Vec3::zero(), V::empty(), ()), Vec3::zero());
|
||||
|
@ -24,6 +24,7 @@ use crate::{
|
||||
pub struct LoadoutBuilder(Loadout);
|
||||
|
||||
impl LoadoutBuilder {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self(Loadout {
|
||||
active_item: None,
|
||||
|
@ -6,6 +6,7 @@ use sum_type::sum_type;
|
||||
// Automatically derive From<T> for EcsCompPacket
|
||||
// for each variant EcsCompPacket::T(T.)
|
||||
sum_type! {
|
||||
#[allow(clippy::large_enum_variant)] // TODO: Pending review in #587
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub enum EcsCompPacket {
|
||||
Body(comp::Body),
|
||||
|
@ -31,6 +31,7 @@ impl<T> FromIterator<T> for Path<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::len_without_is_empty)] // TODO: Pending review in #587
|
||||
impl<T> Path<T> {
|
||||
pub fn len(&self) -> usize { self.nodes.len() }
|
||||
|
||||
@ -151,6 +152,7 @@ impl Chaser {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::float_cmp)] // TODO: Pending review in #587
|
||||
fn find_path<V>(
|
||||
astar: &mut Option<Astar<Vec3<i32>, DefaultHashBuilder>>,
|
||||
vol: &V,
|
||||
|
@ -89,6 +89,7 @@ pub struct RegionMap {
|
||||
tick: u64,
|
||||
}
|
||||
impl RegionMap {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
regions: IndexMap::default(),
|
||||
@ -222,6 +223,7 @@ impl RegionMap {
|
||||
|
||||
/// Finds the region where a given entity is located using a given position
|
||||
/// to speed up the search
|
||||
#[allow(clippy::needless_range_loop)] // TODO: Pending review in #587
|
||||
pub fn find_region(&self, entity: specs::Entity, pos: Vec3<f32>) -> Option<Vec2<i32>> {
|
||||
let id = entity.id();
|
||||
// Compute key for most likely region
|
||||
@ -306,6 +308,7 @@ impl RegionMap {
|
||||
}
|
||||
|
||||
/// Add a region using its key
|
||||
#[allow(clippy::needless_range_loop)] // TODO: Pending review in #587
|
||||
fn remove_index(&mut self, index: usize) {
|
||||
// Remap neighbor indices for neighbors of the region that will be moved from
|
||||
// the end of the index map
|
||||
|
@ -9,12 +9,15 @@ pub struct Spiral2d {
|
||||
}
|
||||
|
||||
impl Spiral2d {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self { Self { layer: 0, i: 0 } }
|
||||
}
|
||||
|
||||
impl Iterator for Spiral2d {
|
||||
type Item = Vec2<i32>;
|
||||
|
||||
#[allow(clippy::erasing_op)] // TODO: Pending review in #587
|
||||
#[allow(clippy::identity_op)] // TODO: Pending review in #587
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
let layer_size = (self.layer * 8 + 4 * self.layer.min(1) - 4).max(1);
|
||||
if self.i >= layer_size {
|
||||
|
@ -69,6 +69,7 @@ impl CharacterBehavior for Data {
|
||||
fn behavior(&self, data: &JoinData) -> StateUpdate {
|
||||
let mut update = StateUpdate::from(data);
|
||||
|
||||
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
|
||||
let stage_time_active = self
|
||||
.stage_time_active
|
||||
.checked_add(Duration::from_secs_f32(data.dt.0))
|
||||
|
@ -40,6 +40,7 @@ pub fn handle_move(data: &JoinData, update: &mut StateUpdate, efficiency: f32) {
|
||||
}
|
||||
|
||||
/// 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 (accel, speed): (f32, f32) = if data.physics.on_ground {
|
||||
(BASE_HUMANOID_ACCEL, BASE_HUMANOID_SPEED)
|
||||
|
@ -116,6 +116,7 @@ pub struct CompSyncPackage<P: CompPacket> {
|
||||
}
|
||||
|
||||
impl<P: CompPacket> CompSyncPackage<P> {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
comp_updates: Vec::new(),
|
||||
|
@ -23,6 +23,7 @@ use vek::*;
|
||||
/// This system will allow NPCs to modify their controller
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Read<'a, UidAllocator>,
|
||||
Read<'a, Time>,
|
||||
@ -42,6 +43,7 @@ impl<'a> System<'a> for Sys {
|
||||
ReadStorage<'a, MountState>,
|
||||
);
|
||||
|
||||
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
|
||||
fn run(
|
||||
&mut self,
|
||||
(
|
||||
|
@ -109,6 +109,7 @@ impl<'a> JoinData<'a> {
|
||||
pub struct Sys;
|
||||
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, UidAllocator>,
|
||||
@ -131,6 +132,7 @@ impl<'a> System<'a> for Sys {
|
||||
ReadStorage<'a, Mounting>,
|
||||
);
|
||||
|
||||
#[allow(clippy::while_let_on_iterator)] // TODO: Pending review in #587
|
||||
fn run(
|
||||
&mut self,
|
||||
(
|
||||
|
@ -16,6 +16,7 @@ pub const BLOCK_ANGLE: f32 = 180.0;
|
||||
/// attacking
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, EventBus<ServerEvent>>,
|
||||
|
@ -15,6 +15,7 @@ use specs::{
|
||||
pub struct Sys;
|
||||
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, UidAllocator>,
|
||||
|
@ -11,6 +11,7 @@ use vek::*;
|
||||
/// This system is responsible for controlling mounts
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Read<'a, UidAllocator>,
|
||||
Entities<'a>,
|
||||
@ -22,6 +23,7 @@ impl<'a> System<'a> for Sys {
|
||||
WriteStorage<'a, Ori>,
|
||||
);
|
||||
|
||||
#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587
|
||||
fn run(
|
||||
&mut self,
|
||||
(
|
||||
|
@ -38,6 +38,7 @@ fn integrate_forces(dt: f32, mut lv: Vec3<f32>, grav: f32, damp: f32) -> Vec3<f3
|
||||
/// This system applies forces and calculates new positions and velocities.
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
ReadStorage<'a, Uid>,
|
||||
@ -56,6 +57,8 @@ impl<'a> System<'a> for Sys {
|
||||
ReadStorage<'a, Mounting>,
|
||||
);
|
||||
|
||||
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
|
||||
#[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587
|
||||
fn run(
|
||||
&mut self,
|
||||
(
|
||||
|
@ -14,6 +14,7 @@ use vek::*;
|
||||
/// This system is responsible for handling projectile effect triggers
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, DeltaTime>,
|
||||
|
@ -10,6 +10,7 @@ const ENERGY_REGEN_ACCEL: f32 = 10.0;
|
||||
/// This system kills players, levels them up, and regenerates energy.
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, DeltaTime>,
|
||||
|
@ -167,6 +167,7 @@ impl<V: Vox, S: RectVolSize, M: Clone> Iterator for ChonkIterHelper<V, S, M> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
pub struct ChonkPosIter<V: Vox, S: RectVolSize, M: Clone> {
|
||||
outer: ChonkIterHelper<V, S, M>,
|
||||
opt_inner: Option<(i32, ChunkPosIter<V, SubChunkSize<S>, M>)>,
|
||||
|
@ -40,6 +40,7 @@ pub fn linear_to_srgba(col: Rgba<f32>) -> Rgba<f32> {
|
||||
/// Convert rgb to hsv. Expects rgb to be [0, 1].
|
||||
#[inline(always)]
|
||||
#[allow(clippy::many_single_char_names)]
|
||||
#[allow(clippy::float_cmp)] // TODO: Pending review in #587
|
||||
pub fn rgb_to_hsv(rgb: Rgb<f32>) -> Vec3<f32> {
|
||||
let (r, g, b) = rgb.into_tuple();
|
||||
let (max, min, diff, add) = {
|
||||
|
@ -4,7 +4,7 @@ mod dir;
|
||||
pub const GIT_VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/githash"));
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
pub static ref GIT_HASH: &'static str = GIT_VERSION.split('/').nth(0).expect("failed to retrieve git_hash!");
|
||||
pub static ref GIT_HASH: &'static str = GIT_VERSION.split('/').next().expect("failed to retrieve git_hash!");
|
||||
pub static ref GIT_DATE: &'static str = GIT_VERSION.split('/').nth(1).expect("failed to retrieve git_date!");
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,7 @@ pub trait ReadVol: BaseVol {
|
||||
/// Get a reference to the voxel at the provided position in the volume.
|
||||
fn get<'a>(&'a self, pos: Vec3<i32>) -> Result<&'a Self::Vox, Self::Error>;
|
||||
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
fn ray<'a>(
|
||||
&'a self,
|
||||
from: Vec3<f32>,
|
||||
|
@ -208,6 +208,7 @@ impl<V: Vox, S: VolSize, M> ReadVol for Chunk<V, S, M> {
|
||||
|
||||
impl<V: Vox, S: VolSize, M> WriteVol for Chunk<V, S, M> {
|
||||
#[inline(always)]
|
||||
#[allow(clippy::unit_arg)] // TODO: Pending review in #587
|
||||
fn set(&mut self, pos: Vec3<i32>, vox: Self::Vox) -> Result<(), Self::Error> {
|
||||
if !pos
|
||||
.map2(S::SIZE, |e, s| 0 <= e && e < s as i32)
|
||||
|
@ -148,6 +148,7 @@ impl<V: RectRasterableVol> VolGrid2d<V> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::needless_lifetimes)] // TODO: Pending review in #587
|
||||
pub fn cached<'a>(&'a self) -> CachedVolGrid2d<'a, V> { CachedVolGrid2d::new(self) }
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ use std::time::Duration;
|
||||
|
||||
const TPS: u64 = 30;
|
||||
|
||||
#[allow(clippy::redundant_pattern_matching)] // TODO: Pending review in #587
|
||||
fn main() {
|
||||
// Init logging
|
||||
if let Err(_) = std::env::var("RUST_LOG") {
|
||||
|
@ -22,6 +22,7 @@ pub struct ChunkGenerator {
|
||||
pending_chunks: HashMap<Vec2<i32>, Arc<AtomicBool>>,
|
||||
}
|
||||
impl ChunkGenerator {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
let (chunk_tx, chunk_rx) = channel::unbounded();
|
||||
Self {
|
||||
|
@ -29,6 +29,7 @@ pub trait ChatCommandExt {
|
||||
fn execute(&self, server: &mut Server, entity: EcsEntity, args: String);
|
||||
}
|
||||
impl ChatCommandExt for ChatCommand {
|
||||
#[allow(clippy::needless_return)] // TODO: Pending review in #587
|
||||
fn execute(&self, server: &mut Server, entity: EcsEntity, args: String) {
|
||||
let cmd_data = self.data();
|
||||
if cmd_data.needs_admin && !server.entity_is_admin(entity) {
|
||||
@ -91,6 +92,8 @@ 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,
|
||||
@ -189,6 +192,7 @@ fn handle_jump(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn handle_goto(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -220,6 +224,8 @@ fn handle_goto(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::collapsible_if)] // TODO: Pending review in #587
|
||||
#[allow(clippy::option_map_unit_fn)] // TODO: Pending review in #587
|
||||
fn handle_kill(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -244,6 +250,7 @@ fn handle_kill(
|
||||
.map(|s| s.health.set_to(0, reason));
|
||||
}
|
||||
|
||||
#[allow(clippy::option_as_ref_deref)] // TODO: Pending review in #587
|
||||
fn handle_time(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -331,6 +338,7 @@ fn handle_health(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn handle_alias(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -377,6 +385,9 @@ fn handle_alias(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::collapsible_if)] // TODO: Pending review in #587
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn handle_tp(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -428,6 +439,8 @@ fn handle_tp(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
#[allow(clippy::redundant_clone)] // TODO: Pending review in #587
|
||||
fn handle_spawn(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -573,6 +586,7 @@ fn handle_build(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn handle_help(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -624,6 +638,9 @@ fn handle_kill_npcs(
|
||||
server.notify_client(client, ServerMsg::private(text));
|
||||
}
|
||||
|
||||
#[allow(clippy::float_cmp)] // TODO: Pending review in #587
|
||||
#[allow(clippy::needless_return)] // TODO: Pending review in #587
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn handle_object(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -688,6 +705,7 @@ fn handle_object(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn handle_light(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -750,6 +768,7 @@ fn handle_light(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn handle_lantern(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -862,6 +881,7 @@ fn handle_waypoint(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn handle_adminify(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -903,6 +923,8 @@ fn handle_adminify(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn handle_tell(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -987,6 +1009,8 @@ 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
|
||||
fn handle_debug_column(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -1067,6 +1091,7 @@ spawn_rate {:?} "#,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
|
||||
fn find_target(
|
||||
ecs: &specs::World,
|
||||
opt_alias: Option<String>,
|
||||
@ -1207,6 +1232,7 @@ fn handle_debug(
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn handle_remove_lights(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
@ -1258,6 +1284,10 @@ 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::or_fun_call)] // TODO: Pending review in #587
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn handle_sudo(
|
||||
server: &mut Server,
|
||||
client: EcsEntity,
|
||||
|
@ -22,6 +22,7 @@ pub fn handle_create_character(
|
||||
sys::subscription::initialize_region_subscription(state.ecs(), entity);
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)] // TODO: Pending review in #587
|
||||
pub fn handle_create_npc(
|
||||
server: &mut Server,
|
||||
pos: Pos,
|
||||
|
@ -24,6 +24,8 @@ pub fn handle_damage(server: &Server, uid: Uid, change: HealthChange) {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::collapsible_if)] // TODO: Pending review in #587
|
||||
#[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();
|
||||
|
||||
@ -333,6 +335,7 @@ 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;
|
||||
|
||||
|
@ -48,6 +48,7 @@ pub fn handle_lantern(server: &mut Server, entity: EcsEntity) {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
pub fn handle_mount(server: &mut Server, mounter: EcsEntity, mountee: EcsEntity) {
|
||||
let state = server.state_mut();
|
||||
|
||||
@ -80,6 +81,7 @@ 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
|
||||
@ -97,6 +99,8 @@ pub fn handle_unmount(server: &mut Server, mounter: EcsEntity) {
|
||||
state.delete_component::<comp::Mounting>(mounter);
|
||||
}
|
||||
|
||||
#[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();
|
||||
|
@ -29,6 +29,9 @@ pub fn snuff_lantern(storage: &mut WriteStorage<comp::LightEmitter>, entity: Ecs
|
||||
storage.remove(entity);
|
||||
}
|
||||
|
||||
#[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587
|
||||
#[allow(clippy::collapsible_if)] // 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();
|
||||
let mut dropped_items = Vec::new();
|
||||
|
@ -87,6 +87,8 @@ pub struct Server {
|
||||
|
||||
impl Server {
|
||||
/// Create a new `Server`
|
||||
#[allow(clippy::expect_fun_call)] // TODO: Pending review in #587
|
||||
#[allow(clippy::needless_update)] // TODO: Pending review in #587
|
||||
pub fn new(settings: ServerSettings) -> Result<Self, Error> {
|
||||
let mut state = State::default();
|
||||
state.ecs_mut().insert(EventBus::<ServerEvent>::default());
|
||||
|
@ -34,6 +34,7 @@ pub struct ServerMetrics {
|
||||
}
|
||||
|
||||
impl TickMetrics {
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
pub fn new(registry: &Registry, tick: Arc<AtomicU64>) -> Result<Self, Box<dyn Error>> {
|
||||
let player_online = IntGauge::with_opts(Opts::new(
|
||||
"player_online",
|
||||
@ -102,6 +103,7 @@ impl TickMetrics {
|
||||
}
|
||||
|
||||
impl ServerMetrics {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
let running = Arc::new(AtomicBool::new(false));
|
||||
let tick = Arc::new(AtomicU64::new(0));
|
||||
|
@ -23,6 +23,7 @@ type CharacterListResult = Result<Vec<CharacterItem>, Error>;
|
||||
///
|
||||
/// After first logging in, and after a character is selected, we fetch this
|
||||
/// data for the purpose of inserting their persisted data for the entity.
|
||||
#[allow(clippy::redundant_closure)] // TODO: Pending review in #587
|
||||
pub fn load_character_data(
|
||||
character_id: i32,
|
||||
db_dir: &str,
|
||||
@ -101,6 +102,7 @@ pub fn load_character_data(
|
||||
/// In the event that a join fails, for a character (i.e. they lack an entry for
|
||||
/// stats, body, etc...) the character is skipped, and no entry will be
|
||||
/// returned.
|
||||
#[allow(clippy::redundant_closure)] // TODO: Pending review in #587
|
||||
pub fn load_character_list(player_uuid: &str, db_dir: &str) -> CharacterListResult {
|
||||
let data = schema::character::dsl::character
|
||||
.filter(schema::character::player_uuid.eq(player_uuid))
|
||||
|
@ -46,6 +46,7 @@ fn establish_connection(db_dir: &str) -> SqliteConnection {
|
||||
connection
|
||||
}
|
||||
|
||||
#[allow(clippy::single_match)] // TODO: Pending review in #587
|
||||
fn apply_saves_dir_override(db_dir: &str) -> String {
|
||||
if let Some(val) = env::var_os("VELOREN_SAVES_DIR") {
|
||||
let path = PathBuf::from(val);
|
||||
|
@ -63,6 +63,7 @@ impl Default for ServerSettings {
|
||||
}
|
||||
|
||||
impl ServerSettings {
|
||||
#[allow(clippy::single_match)] // TODO: Pending review in #587
|
||||
pub fn load() -> Self {
|
||||
let path = ServerSettings::get_settings_path();
|
||||
|
||||
|
@ -65,6 +65,7 @@ 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) => {
|
||||
@ -152,6 +153,7 @@ impl StateExt for State {
|
||||
.with(comp::Sticky)
|
||||
}
|
||||
|
||||
#[allow(clippy::unnecessary_operation)] // TODO: Pending review in #587
|
||||
fn create_player_character(
|
||||
&mut self,
|
||||
entity: EcsEntity,
|
||||
|
@ -20,6 +20,7 @@ use specs::{
|
||||
/// This system will send physics updates to the client
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, Tick>,
|
||||
@ -43,6 +44,7 @@ impl<'a> System<'a> for Sys {
|
||||
ReadTrackers<'a>,
|
||||
);
|
||||
|
||||
#[allow(clippy::redundant_closure)] // TODO: Pending review in #587
|
||||
fn run(
|
||||
&mut self,
|
||||
(
|
||||
|
@ -26,6 +26,7 @@ use specs::{
|
||||
/// This system will handle new messages from clients
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, EventBus<ServerEvent>>,
|
||||
@ -49,6 +50,10 @@ impl<'a> System<'a> for Sys {
|
||||
WriteStorage<'a, SpeechBubble>,
|
||||
);
|
||||
|
||||
#[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(
|
||||
&mut self,
|
||||
(
|
||||
|
@ -8,6 +8,7 @@ use specs::{Join, ReadExpect, ReadStorage, System, Write};
|
||||
pub struct Sys;
|
||||
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
ReadStorage<'a, Player>,
|
||||
ReadStorage<'a, Stats>,
|
||||
|
@ -57,6 +57,7 @@ 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,
|
||||
|
@ -21,6 +21,7 @@ use vek::*;
|
||||
/// This system will update region subscriptions based on client positions
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
ReadExpect<'a, RegionMap>,
|
||||
@ -36,6 +37,8 @@ impl<'a> System<'a> for Sys {
|
||||
TrackedComps<'a>,
|
||||
);
|
||||
|
||||
#[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587
|
||||
#[allow(clippy::clone_on_copy)] // TODO: Pending review in #587
|
||||
fn run(
|
||||
&mut self,
|
||||
(
|
||||
|
@ -23,6 +23,7 @@ use vek::*;
|
||||
/// 4. Removes chunks outside the range of players
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
Read<'a, EventBus<ServerEvent>>,
|
||||
Read<'a, Tick>,
|
||||
@ -35,6 +36,9 @@ impl<'a> System<'a> for Sys {
|
||||
WriteStorage<'a, Client>,
|
||||
);
|
||||
|
||||
#[allow(clippy::identity_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(
|
||||
&mut self,
|
||||
(
|
||||
@ -394,6 +398,8 @@ impl<'a> System<'a> for Sys {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
#[allow(clippy::manual_saturating_arithmetic)] // TODO: Pending review in #587
|
||||
pub fn chunk_in_vd(
|
||||
player_pos: Vec3<f32>,
|
||||
chunk_pos: Vec2<i32>,
|
||||
|
@ -12,6 +12,7 @@ use specs::{Join, Read, ReadExpect, ReadStorage, System, Write, WriteStorage};
|
||||
/// chunks
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
ReadExpect<'a, TerrainGrid>,
|
||||
Read<'a, TerrainChanges>,
|
||||
|
@ -14,6 +14,7 @@ const NOTIFY_TIME: f64 = 10.0;
|
||||
/// TODO: Make this faster by only considering local waypoints
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
ReadStorage<'a, Pos>,
|
||||
|
@ -11,6 +11,7 @@ use world::{sim, World};
|
||||
const CENTER: Vec2<i32> = Vec2 { x: 512, y: 512 };
|
||||
const GEN_SIZE: i32 = 4;
|
||||
|
||||
#[allow(clippy::needless_update)] // TODO: Pending review in #587
|
||||
pub fn criterion_benchmark(c: &mut Criterion) {
|
||||
// Generate chunks here to test
|
||||
let mut terrain = TerrainGrid::new().unwrap();
|
||||
|
@ -3,6 +3,7 @@ use gfx_window_glutin::init_headless;
|
||||
use vek::*;
|
||||
use veloren_voxygen::{render, scene::simple as scene};
|
||||
|
||||
#[allow(clippy::clone_on_copy)] // TODO: Pending review in #587
|
||||
fn main() {
|
||||
// Setup renderer
|
||||
let dim = (200u16, 300u16, 1, gfx::texture::AaMode::Single);
|
||||
|
@ -19,6 +19,7 @@ pub struct BirdSmallSkeleton {
|
||||
}
|
||||
|
||||
impl BirdSmallSkeleton {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
head: Bone::default(),
|
||||
|
@ -9,6 +9,7 @@ impl Animation for AlphaAnimation {
|
||||
type Dependency = (Option<ToolKind>, f32, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, velocity, _global_time): Self::Dependency,
|
||||
|
@ -9,6 +9,8 @@ impl Animation for ChargeAnimation {
|
||||
type Dependency = (Option<ToolKind>, f32, Vec3<f32>, Vec3<f32>, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency,
|
||||
|
@ -11,6 +11,7 @@ impl Animation for DashAnimation {
|
||||
type Dependency = (Option<ToolKind>, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::single_match)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, _global_time): Self::Dependency,
|
||||
|
@ -10,6 +10,7 @@ impl Animation for EquipAnimation {
|
||||
type Dependency = (Option<ToolKind>, f32, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, velocity, global_time): Self::Dependency,
|
||||
|
@ -9,6 +9,7 @@ impl Animation for GlidingAnimation {
|
||||
type Dependency = (Option<ToolKind>, Vec3<f32>, Vec3<f32>, Vec3<f32>, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency,
|
||||
|
@ -7,6 +7,7 @@ impl Animation for JumpAnimation {
|
||||
type Dependency = (Option<ToolKind>, Vec3<f32>, Vec3<f32>, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(_active_tool_kind, orientation, last_ori, global_time): Self::Dependency,
|
||||
|
@ -202,6 +202,7 @@ impl SkeletonAttr {
|
||||
}
|
||||
|
||||
impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
#[allow(clippy::match_single_binding)] // TODO: Pending review in #587
|
||||
fn from(body: &'a comp::humanoid::Body) -> Self {
|
||||
use comp::humanoid::{BodyType::*, Species::*};
|
||||
Self {
|
||||
|
@ -8,6 +8,7 @@ impl Animation for RollAnimation {
|
||||
type Dependency = (Option<ToolKind>, Vec3<f32>, Vec3<f32>, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(_active_tool_kind, orientation, last_ori, _global_time): Self::Dependency,
|
||||
|
@ -9,6 +9,7 @@ impl Animation for RunAnimation {
|
||||
type Dependency = (Option<ToolKind>, Vec3<f32>, Vec3<f32>, Vec3<f32>, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency,
|
||||
|
@ -8,6 +8,7 @@ impl Animation for ShootAnimation {
|
||||
type Dependency = (Option<ToolKind>, f32, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, velocity, _global_time): Self::Dependency,
|
||||
|
@ -9,6 +9,7 @@ impl Animation for SwimAnimation {
|
||||
type Dependency = (Option<ToolKind>, Vec3<f32>, Vec3<f32>, Vec3<f32>, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::identity_conversion)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(_active_tool_kind, velocity, orientation, last_ori, global_time): Self::Dependency,
|
||||
|
@ -9,6 +9,7 @@ impl Animation for WieldAnimation {
|
||||
type Dependency = (Option<ToolKind>, f32, f64);
|
||||
type Skeleton = CharacterSkeleton;
|
||||
|
||||
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||
fn update_skeleton(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, velocity, global_time): Self::Dependency,
|
||||
|
@ -80,6 +80,7 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for CritterAttr {
|
||||
}
|
||||
|
||||
impl CritterAttr {
|
||||
#[allow(clippy::match_single_binding)] // TODO: Pending review in #587
|
||||
pub fn calculate_scale(body: &comp::critter::Body) -> f32 {
|
||||
match (body.species, body.body_type) {
|
||||
(_, _) => 0.0,
|
||||
|
@ -21,6 +21,7 @@ pub struct FishMediumSkeleton {
|
||||
}
|
||||
|
||||
impl FishMediumSkeleton {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
head: Bone::default(),
|
||||
|
@ -17,6 +17,7 @@ pub struct FishSmallSkeleton {
|
||||
}
|
||||
|
||||
impl FishSmallSkeleton {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
torso: Bone::default(),
|
||||
|
@ -8,6 +8,7 @@ pub struct FixtureSkeleton;
|
||||
pub struct SkeletonAttr;
|
||||
|
||||
impl FixtureSkeleton {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self { Self {} }
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ pub struct GolemSkeleton {
|
||||
}
|
||||
|
||||
impl GolemSkeleton {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
head: Bone::default(),
|
||||
|
@ -7,6 +7,7 @@ pub struct ObjectSkeleton;
|
||||
pub struct SkeletonAttr;
|
||||
|
||||
impl ObjectSkeleton {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self { Self {} }
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@ impl Fader {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::assign_op_pattern)] // TODO: Pending review in #587
|
||||
pub fn update(&mut self, dt: f32) {
|
||||
if self.is_running {
|
||||
self.running_time = self.running_time + dt;
|
||||
@ -103,6 +104,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::float_cmp)] // TODO: Pending review in #587
|
||||
fn fade_out_completes() {
|
||||
let mut fader = Fader::fade_out(10.0, 1.0);
|
||||
|
||||
@ -146,6 +148,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::float_cmp)] // TODO: Pending review in #587
|
||||
fn update_target_volume_fading_in_when_currently_above() {
|
||||
let mut fader = Fader::fade_in(10.0, 1.0);
|
||||
|
||||
@ -162,6 +165,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::float_cmp)] // TODO: Pending review in #587
|
||||
fn update_target_volume_fading_in_when_currently_below() {
|
||||
let mut fader = Fader::fade_in(20.0, 1.0);
|
||||
|
||||
|
@ -36,6 +36,7 @@ pub struct AudioFrontend {
|
||||
|
||||
impl AudioFrontend {
|
||||
/// Construct with given device
|
||||
#[allow(clippy::redundant_clone)] // TODO: Pending review in #587
|
||||
pub fn new(device: String, max_sfx_channels: usize) -> Self {
|
||||
let mut sfx_channels = Vec::with_capacity(max_sfx_channels);
|
||||
let audio_device = get_device_raw(&device);
|
||||
@ -165,6 +166,7 @@ impl AudioFrontend {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::clone_on_copy)] // TODO: Pending review in #587
|
||||
pub fn set_listener_pos(&mut self, pos: &Vec3<f32>, ori: &Vec3<f32>) {
|
||||
self.listener_pos = pos.clone();
|
||||
self.listener_ori = ori.normalized();
|
||||
|
@ -34,6 +34,7 @@ pub struct MusicMgr {
|
||||
}
|
||||
|
||||
impl MusicMgr {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
soundtrack: Self::load_soundtrack_items(),
|
||||
|
@ -39,6 +39,7 @@ pub struct CombatEventMapper {
|
||||
}
|
||||
|
||||
impl EventMapper for CombatEventMapper {
|
||||
#[allow(clippy::redundant_closure)] // TODO: Pending review in #587
|
||||
fn maintain(&mut self, state: &State, player_entity: EcsEntity, triggers: &SfxTriggers) {
|
||||
let ecs = state.ecs();
|
||||
|
||||
@ -128,6 +129,7 @@ impl CombatEventMapper {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::collapsible_if)] // TODO: Pending review in #587
|
||||
fn map_event(
|
||||
character_state: &CharacterState,
|
||||
previous_state: &PreviousEntityState,
|
||||
|
@ -36,6 +36,7 @@ pub struct MovementEventMapper {
|
||||
}
|
||||
|
||||
impl EventMapper for MovementEventMapper {
|
||||
#[allow(clippy::redundant_closure)] // TODO: Pending review in #587
|
||||
fn maintain(&mut self, state: &State, player_entity: EcsEntity, triggers: &SfxTriggers) {
|
||||
let ecs = state.ecs();
|
||||
|
||||
@ -145,6 +146,7 @@ impl MovementEventMapper {
|
||||
/// as opening or closing the glider. These methods translate those
|
||||
/// entity states with some additional data into more specific
|
||||
/// `SfxEvent`'s which we attach sounds to
|
||||
#[allow(clippy::nonminimal_bool)] // TODO: Pending review in #587
|
||||
fn map_movement_event(
|
||||
character_state: &CharacterState,
|
||||
physics_state: &PhysicsState,
|
||||
|
@ -26,6 +26,7 @@ pub struct ProgressionEventMapper {
|
||||
}
|
||||
|
||||
impl EventMapper for ProgressionEventMapper {
|
||||
#[allow(clippy::op_ref)] // TODO: Pending review in #587
|
||||
fn maintain(&mut self, state: &State, player_entity: specs::Entity, triggers: &SfxTriggers) {
|
||||
let ecs = state.ecs();
|
||||
|
||||
@ -59,6 +60,7 @@ impl ProgressionEventMapper {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::let_and_return)] // TODO: Pending review in #587
|
||||
fn map_event(&mut self, next_state: &ProgressionState) -> Option<SfxEvent> {
|
||||
let sfx_event = if next_state.level > self.state.level {
|
||||
Some(SfxEvent::LevelUp)
|
||||
|
@ -125,6 +125,7 @@ pub struct SfxMgr {
|
||||
}
|
||||
|
||||
impl SfxMgr {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
triggers: Self::load_sfx_items(),
|
||||
|
@ -1,6 +1,5 @@
|
||||
use common::assets;
|
||||
use hashbrown::HashMap;
|
||||
use rodio;
|
||||
use std::{convert::AsRef, io, io::Read, sync::Arc};
|
||||
|
||||
// Implementation of sound taken from this github issue:
|
||||
@ -31,6 +30,7 @@ pub struct SoundCache {
|
||||
}
|
||||
|
||||
impl SoundCache {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
sounds: HashMap::new(),
|
||||
|
@ -16,6 +16,7 @@ pub const MY_EXP_SHOWTIME: f32 = 4.0;
|
||||
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
ReadExpect<'a, MyEntity>,
|
||||
@ -27,6 +28,8 @@ impl<'a> System<'a> for Sys {
|
||||
WriteStorage<'a, HpFloaterList>,
|
||||
);
|
||||
|
||||
#[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,
|
||||
|
@ -11,6 +11,7 @@ use vek::*;
|
||||
/// This system will allow NPCs to modify their controller
|
||||
pub struct Sys;
|
||||
impl<'a> System<'a> for Sys {
|
||||
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
Read<'a, DeltaTime>,
|
||||
@ -20,6 +21,7 @@ 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,
|
||||
|
@ -1,5 +1,4 @@
|
||||
use crate::render::RenderError;
|
||||
use client;
|
||||
use std::fmt::Debug;
|
||||
|
||||
/// Represents any error that may be triggered by Voxygen.
|
||||
|
@ -99,6 +99,7 @@ pub struct Bag<'a> {
|
||||
}
|
||||
|
||||
impl<'a> Bag<'a> {
|
||||
#[allow(clippy::too_many_arguments)] // TODO: Pending review in #587
|
||||
pub fn new(
|
||||
client: &'a Client,
|
||||
imgs: &'a Imgs,
|
||||
@ -149,8 +150,10 @@ impl<'a> Widget for Bag<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { state, ui, .. } = args;
|
||||
|
||||
|
@ -56,6 +56,7 @@ 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,
|
||||
@ -105,6 +106,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -143,8 +143,12 @@ impl<'a> Widget for Chat<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
#[allow(clippy::collapsible_if)] // TODO: Pending review in #587
|
||||
#[allow(clippy::redundant_clone)] // TODO: Pending review in #587
|
||||
#[allow(clippy::single_match)] // TODO: Pending review in #587
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { id, state, ui, .. } = args;
|
||||
let transp = self.global_state.settings.gameplay.chat_transp;
|
||||
|
@ -67,6 +67,7 @@ impl<'a> Widget for EscMenu<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -28,6 +28,7 @@ pub enum ItemKey {
|
||||
Empty,
|
||||
}
|
||||
impl From<&Item> for ItemKey {
|
||||
#[allow(clippy::clone_on_copy)] // TODO: Pending review in #587
|
||||
fn from(item: &Item) -> Self {
|
||||
match &item.kind {
|
||||
ItemKind::Tool(Tool { kind, .. }) => ItemKey::Tool(kind.clone()),
|
||||
|
@ -46,6 +46,7 @@ pub struct Map<'a> {
|
||||
localized_strings: &'a std::sync::Arc<VoxygenLocalization>,
|
||||
}
|
||||
impl<'a> Map<'a> {
|
||||
#[allow(clippy::too_many_arguments)] // TODO: Pending review in #587
|
||||
pub fn new(
|
||||
show: &'a Show,
|
||||
client: &'a Client,
|
||||
@ -89,8 +90,10 @@ impl<'a> Widget for Map<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { state, ui, .. } = args;
|
||||
|
||||
|
@ -92,6 +92,7 @@ impl<'a> Widget for MiniMap<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -553,6 +553,9 @@ impl Hud {
|
||||
.expect("Impossible to load fonts!");
|
||||
}
|
||||
|
||||
#[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,
|
||||
client: &Client,
|
||||
@ -1906,6 +1909,7 @@ 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(
|
||||
@ -2132,6 +2136,7 @@ impl Hud {
|
||||
handled
|
||||
}
|
||||
|
||||
#[allow(clippy::block_in_if_condition_stmt)] // TODO: Pending review in #587
|
||||
pub fn maintain(
|
||||
&mut self,
|
||||
client: &Client,
|
||||
|
@ -60,6 +60,7 @@ pub struct Overhead<'a> {
|
||||
}
|
||||
|
||||
impl<'a> Overhead<'a> {
|
||||
#[allow(clippy::too_many_arguments)] // TODO: Pending review in #587
|
||||
pub fn new(
|
||||
name: &'a str,
|
||||
bubble: Option<&'a SpeechBubble>,
|
||||
@ -117,6 +118,7 @@ impl<'a> Widget for Overhead<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -80,8 +80,10 @@ impl<'a> Widget for Popup<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
#[allow(clippy::single_match)] // TODO: Pending review in #587
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { state, ui, .. } = args;
|
||||
|
||||
|
@ -265,6 +265,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -139,6 +139,7 @@ pub struct Skillbar<'a> {
|
||||
}
|
||||
|
||||
impl<'a> Skillbar<'a> {
|
||||
#[allow(clippy::too_many_arguments)] // TODO: Pending review in #587
|
||||
pub fn new(
|
||||
global_state: &'a GlobalState,
|
||||
imgs: &'a Imgs,
|
||||
@ -207,6 +208,7 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -77,6 +77,7 @@ impl<'a> Widget for Social<'a> {
|
||||
|
||||
fn init_state(&self, id_gen: widget::id::Generator) -> Self::State { Ids::new(id_gen) }
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -67,6 +67,7 @@ impl<'a> Widget for Spell<'a> {
|
||||
|
||||
fn init_state(&self, id_gen: widget::id::Generator) -> Self::State { Ids::new(id_gen) }
|
||||
|
||||
#[allow(clippy::unused_unit)] // TODO: Pending review in #587
|
||||
fn style(&self) -> Self::Style { () }
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
|
@ -145,6 +145,7 @@ impl Asset for VoxygenLocalization {
|
||||
|
||||
/// Load the translations located in the input buffer and convert them
|
||||
/// into a `VoxygenLocalization` object.
|
||||
#[allow(clippy::into_iter_on_ref)] // TODO: Pending review in #587
|
||||
fn parse(buf_reader: BufReader<File>) -> Result<Self, assets::Error> {
|
||||
let mut asked_localization: VoxygenLocalization =
|
||||
from_reader(buf_reader).map_err(assets::Error::parse_error)?;
|
||||
|
@ -17,6 +17,7 @@ pub struct KeyState {
|
||||
}
|
||||
|
||||
impl KeyState {
|
||||
#[allow(clippy::new_without_default)] // TODO: Pending review in #587
|
||||
pub fn new() -> KeyState {
|
||||
KeyState {
|
||||
right: false,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user