From d3d4ee8bb0008a6a57dd8d5042848ca279807063 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 30 Apr 2021 16:11:21 -0400 Subject: [PATCH] Formatting stuffs. --- common/src/comp/inventory/item/mod.rs | 5 ++--- voxygen/anim/src/biped_large/alpha.rs | 1 + voxygen/anim/src/biped_large/beta.rs | 1 + voxygen/anim/src/biped_large/blink.rs | 1 + voxygen/anim/src/biped_large/shoot.rs | 1 + voxygen/anim/src/biped_large/spinmelee.rs | 1 + voxygen/anim/src/biped_large/stunned.rs | 5 ++++- voxygen/anim/src/biped_large/summon.rs | 1 + voxygen/anim/src/biped_large/wield.rs | 1 + voxygen/anim/src/character/beta.rs | 3 +++ voxygen/anim/src/character/chargeswing.rs | 3 +++ voxygen/anim/src/character/talk.rs | 4 +++- 12 files changed, 22 insertions(+), 5 deletions(-) diff --git a/common/src/comp/inventory/item/mod.rs b/common/src/comp/inventory/item/mod.rs index 1ab3430bd4..2814745ef2 100644 --- a/common/src/comp/inventory/item/mod.rs +++ b/common/src/comp/inventory/item/mod.rs @@ -319,11 +319,10 @@ impl TryFrom<(&Item, &AbilityMap, &MaterialStatManifest)> for ItemConfig { tool_default.unwrap_or_default() } } else if let Some(set) = tool_default { - set.modified_by_tool(&tool, msm, &item.components) + set.modified_by_tool(&tool, msm, &item.components) } else { error!( - "No ability set defined for tool: {:?}, falling back to default ability \ - set.", + "No ability set defined for tool: {:?}, falling back to default ability set.", tool.kind ); Default::default() diff --git a/voxygen/anim/src/biped_large/alpha.rs b/voxygen/anim/src/biped_large/alpha.rs index df9b9a6796..27d6f70049 100644 --- a/voxygen/anim/src/biped_large/alpha.rs +++ b/voxygen/anim/src/biped_large/alpha.rs @@ -11,6 +11,7 @@ use std::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/beta.rs b/voxygen/anim/src/biped_large/beta.rs index 331ca0b243..6af78b06e6 100644 --- a/voxygen/anim/src/biped_large/beta.rs +++ b/voxygen/anim/src/biped_large/beta.rs @@ -11,6 +11,7 @@ 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/blink.rs b/voxygen/anim/src/biped_large/blink.rs index 3905e4a508..d24bd0a605 100644 --- a/voxygen/anim/src/biped_large/blink.rs +++ b/voxygen/anim/src/biped_large/blink.rs @@ -77,6 +77,7 @@ impl Animation for BlinkAnimation { next.hand_l.orientation = Quaternion::rotation_x(0.0); next.hand_r.orientation = Quaternion::rotation_x(0.0); + #[allow(clippy::single_match)] match active_tool_kind { Some(ToolKind::Staff) => { next.head.orientation = diff --git a/voxygen/anim/src/biped_large/shoot.rs b/voxygen/anim/src/biped_large/shoot.rs index 7656e766f6..42d9717950 100644 --- a/voxygen/anim/src/biped_large/shoot.rs +++ b/voxygen/anim/src/biped_large/shoot.rs @@ -187,6 +187,7 @@ impl Animation for ShootAnimation { }, Some(ToolKind::Natural) => { if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { + #[allow(clippy::single_match)] match spec.as_str() { "Wendigo Magic" => { let (move1base, _move2base, move3) = match stage_section { diff --git a/voxygen/anim/src/biped_large/spinmelee.rs b/voxygen/anim/src/biped_large/spinmelee.rs index c6f764db6f..73a242d3a5 100644 --- a/voxygen/anim/src/biped_large/spinmelee.rs +++ b/voxygen/anim/src/biped_large/spinmelee.rs @@ -80,6 +80,7 @@ impl Animation for SpinMeleeAnimation { next.hand_l.orientation = Quaternion::rotation_x(0.0); next.hand_r.orientation = Quaternion::rotation_x(0.0); + #[allow(clippy::single_match)] match active_tool_kind { Some(ToolKind::Staff) => { next.head.orientation = Quaternion::rotation_x(move1 * -0.3 + move2 * 0.5); diff --git a/voxygen/anim/src/biped_large/stunned.rs b/voxygen/anim/src/biped_large/stunned.rs index 87d8ab9538..cfd429d812 100644 --- a/voxygen/anim/src/biped_large/stunned.rs +++ b/voxygen/anim/src/biped_large/stunned.rs @@ -11,6 +11,7 @@ use std::f32::consts::PI; pub struct StunnedAnimation; impl Animation for StunnedAnimation { + #[allow(clippy::type_complexity)] type Dependency<'a> = ( (Option, Option<&'a AbilitySpec>), Vec3, @@ -25,7 +26,9 @@ impl Animation for StunnedAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_stunned")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - ((active_tool_kind, active_tool_spec), velocity, acc_vel, stage_section): Self::Dependency<'a>, + ((active_tool_kind, active_tool_spec), velocity, acc_vel, stage_section): Self::Dependency< + 'a, + >, anim_time: f32, _rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/biped_large/summon.rs b/voxygen/anim/src/biped_large/summon.rs index ce462c10ba..9fa16305b5 100644 --- a/voxygen/anim/src/biped_large/summon.rs +++ b/voxygen/anim/src/biped_large/summon.rs @@ -81,6 +81,7 @@ impl Animation for SummonAnimation { next.hand_l.orientation = Quaternion::rotation_x(0.0); next.hand_r.orientation = Quaternion::rotation_x(0.0); + #[allow(clippy::single_match)] match active_tool_kind { Some(ToolKind::Staff) => { next.head.orientation = Quaternion::rotation_x(0.0); diff --git a/voxygen/anim/src/biped_large/wield.rs b/voxygen/anim/src/biped_large/wield.rs index b1f4d90c70..f37bf0dc30 100644 --- a/voxygen/anim/src/biped_large/wield.rs +++ b/voxygen/anim/src/biped_large/wield.rs @@ -8,6 +8,7 @@ use std::{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/beta.rs b/voxygen/anim/src/character/beta.rs index a0b17eb0fb..29fd342872 100644 --- a/voxygen/anim/src/character/beta.rs +++ b/voxygen/anim/src/character/beta.rs @@ -51,6 +51,7 @@ impl Animation for BetaAnimation { * Quaternion::rotation_z((0.4 + move1 * 1.5 + move2 * -2.5) * pullback); next.head.orientation = Quaternion::rotation_z(-0.4 + move1 * -1.0 + move2 * 1.5); } + #[allow(clippy::single_match)] match hands { (Some(Hands::Two), _) | (None, Some(Hands::Two)) => match ability_info .and_then(|a| a.tool) @@ -80,6 +81,7 @@ impl Animation for BetaAnimation { }; match hands { + #[allow(clippy::single_match)] (Some(Hands::One), _) => match ability_info.and_then(|a| a.tool) { Some(ToolKind::Sword) => { next.control_l.position = Vec3::new(-12.0, 8.0, 2.0); @@ -95,6 +97,7 @@ impl Animation for BetaAnimation { (_, _) => {}, }; match hands { + #[allow(clippy::single_match)] (None | Some(Hands::One), Some(Hands::One)) => { match ability_info.and_then(|a| a.tool) { Some(ToolKind::Sword) => { diff --git a/voxygen/anim/src/character/chargeswing.rs b/voxygen/anim/src/character/chargeswing.rs index 25f5743e87..8adc62d3b9 100644 --- a/voxygen/anim/src/character/chargeswing.rs +++ b/voxygen/anim/src/character/chargeswing.rs @@ -81,6 +81,7 @@ impl Animation for ChargeswingAnimation { } match hands { + #[allow(clippy::single_match)] (Some(Hands::Two), _) | (None, Some(Hands::Two)) => match ability_info .and_then(|a| a.tool) { @@ -113,6 +114,7 @@ impl Animation for ChargeswingAnimation { }; match hands { + #[allow(clippy::single_match)] (Some(Hands::One), _) => match ability_info.and_then(|a| a.tool) { Some(ToolKind::Hammer) => { next.control_l.position = Vec3::new( @@ -133,6 +135,7 @@ impl Animation for ChargeswingAnimation { }; match hands { + #[allow(clippy::single_match)] (None | Some(Hands::One), Some(Hands::One)) => { match ability_info.and_then(|a| a.tool) { Some(ToolKind::Hammer) => { diff --git a/voxygen/anim/src/character/talk.rs b/voxygen/anim/src/character/talk.rs index ec2a303b2a..f2fe4bbfb2 100644 --- a/voxygen/anim/src/character/talk.rs +++ b/voxygen/anim/src/character/talk.rs @@ -18,7 +18,9 @@ impl Animation for TalkAnimation { #[allow(clippy::approx_constant)] // TODO: Pending review in #587 fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_active_tool_kind, _second_tool_kind, _velocity, _global_time, look_dir): Self::Dependency<'a>, + (_active_tool_kind, _second_tool_kind, _velocity, _global_time, look_dir): Self::Dependency< + 'a, + >, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr,