chore: fix trait errors

This commit is contained in:
2026-06-26 14:06:47 +02:00
parent da105ffb14
commit 3e014044ca
5 changed files with 16 additions and 14 deletions
+2
View File
@@ -173,6 +173,8 @@
clippy::all, clippy::all,
nonstandard_style, nonstandard_style,
rust_2018_idioms, rust_2018_idioms,
unused,
warnings,
missing_debug_implementations missing_debug_implementations
)] )]
+4 -4
View File
@@ -46,10 +46,10 @@ impl Skill for Aim {
<Self as StrainSkill>::process(self, curr, diff_objects) <Self as StrainSkill>::process(self, curr, diff_objects)
} }
#[inline] /* #[inline]
fn difficulty_value(&mut self) -> f64 { fn difficulty_value(&mut self) -> f64 {
<Self as OsuStrainSkill>::difficulty_value(self) <Self as OsuStrainSkill>::difficulty_value(self)
} } */
} }
impl StrainSkill for Aim { impl StrainSkill for Aim {
@@ -93,10 +93,10 @@ impl StrainSkill for Aim {
self.curr_strain * Self::strain_decay(time - previous_start_time(diff_objects, curr.idx, 0)) self.curr_strain * Self::strain_decay(time - previous_start_time(diff_objects, curr.idx, 0))
} }
#[inline] /* #[inline]
fn difficulty_value(&mut self) -> f64 { fn difficulty_value(&mut self) -> f64 {
<Self as OsuStrainSkill>::difficulty_value(self) <Self as OsuStrainSkill>::difficulty_value(self)
} } */
} }
impl OsuStrainSkill for Aim { impl OsuStrainSkill for Aim {
+4 -4
View File
@@ -49,10 +49,10 @@ impl Skill for Flashlight {
<Self as StrainSkill>::process(self, curr, diff_objects) <Self as StrainSkill>::process(self, curr, diff_objects)
} }
#[inline] /* #[inline]
fn difficulty_value(&mut self) -> f64 { fn difficulty_value(&mut self) -> f64 {
<Self as StrainSkill>::difficulty_value(self) <Self as StrainSkill>::difficulty_value(self)
} } */
} }
impl StrainSkill for Flashlight { impl StrainSkill for Flashlight {
@@ -102,10 +102,10 @@ impl StrainSkill for Flashlight {
self.curr_strain * Self::strain_decay(time - previous_start_time(diff_objects, curr.idx, 0)) self.curr_strain * Self::strain_decay(time - previous_start_time(diff_objects, curr.idx, 0))
} }
#[inline] /* #[inline]
fn difficulty_value(&mut self) -> f64 { fn difficulty_value(&mut self) -> f64 {
self.get_curr_strain_peaks().into_iter().sum::<f64>() * Self::DIFFICULTY_MULTIPLER self.get_curr_strain_peaks().into_iter().sum::<f64>() * Self::DIFFICULTY_MULTIPLER
} } */
} }
const HOLDING_VEC: &Vec<f64> = &vec![]; const HOLDING_VEC: &Vec<f64> = &vec![];
+4 -4
View File
@@ -63,10 +63,10 @@ impl Skill for Speed {
<Self as StrainSkill>::process(self, curr, diff_objects) <Self as StrainSkill>::process(self, curr, diff_objects)
} }
#[inline] /* #[inline]
fn difficulty_value(&mut self) -> f64 { fn difficulty_value(&mut self) -> f64 {
<Self as OsuStrainSkill>::difficulty_value(self) <Self as OsuStrainSkill>::difficulty_value(self)
} } */
} }
impl StrainSkill for Speed { impl StrainSkill for Speed {
@@ -114,10 +114,10 @@ impl StrainSkill for Speed {
* Self::strain_decay(time - previous_start_time(diff_objects, curr.idx, 0)) * Self::strain_decay(time - previous_start_time(diff_objects, curr.idx, 0))
} }
#[inline] /* #[inline]
fn difficulty_value(&mut self) -> f64 { fn difficulty_value(&mut self) -> f64 {
<Self as OsuStrainSkill>::difficulty_value(self) <Self as OsuStrainSkill>::difficulty_value(self)
} } */
} }
impl OsuStrainSkill for Speed { impl OsuStrainSkill for Speed {
+2 -2
View File
@@ -4,7 +4,7 @@ use crate::osu::{difficulty_object::OsuDifficultyObject, SECTION_LEN};
pub(crate) trait Skill { pub(crate) trait Skill {
fn process(&mut self, curr: &OsuDifficultyObject<'_>, diff_objects: &[OsuDifficultyObject<'_>]); fn process(&mut self, curr: &OsuDifficultyObject<'_>, diff_objects: &[OsuDifficultyObject<'_>]);
fn difficulty_value(&mut self) -> f64; //fn difficulty_value(&mut self) -> f64;
} }
pub(crate) trait StrainSkill: Skill + Sized { pub(crate) trait StrainSkill: Skill + Sized {
@@ -73,7 +73,7 @@ pub(crate) trait StrainSkill: Skill + Sized {
*self.curr_section_peak() = self.calculate_initial_strain(time, curr, diff_objects); *self.curr_section_peak() = self.calculate_initial_strain(time, curr, diff_objects);
} }
fn difficulty_value(&mut self) -> f64; // fn difficulty_value(&mut self) -> f64;
#[inline] #[inline]
fn get_curr_strain_peaks(&mut self) -> Vec<f64> { fn get_curr_strain_peaks(&mut self) -> Vec<f64> {