Style and Clippy fixes.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-10-14 16:53:30 +02:00
parent 9efe1b4e22
commit 691bf7c12e
56 changed files with 354 additions and 249 deletions

View File

@@ -24,6 +24,12 @@ pub struct Gen7BattleStatCalculator {
identifier: ValueIdentifier,
}
impl Default for Gen7BattleStatCalculator {
fn default() -> Self {
Self::new()
}
}
impl Gen7BattleStatCalculator {
/// Creates a new Gen 7 battle stat calculator
pub fn new() -> Self {

View File

@@ -224,11 +224,7 @@ impl DamageLibrary for Gen7DamageLibrary {
float_damage = (float_damage * hit_data.effectiveness()).floor();
let mut damage = if float_damage <= 0.0 {
if hit_data.effectiveness() == 0.0 {
0
} else {
1
}
u32::from(hit_data.effectiveness() != 0.0)
} else if float_damage >= u32::MAX as f32 {
u32::MAX
} else {