made clippy happy
This commit is contained in:
@@ -171,10 +171,14 @@ impl Distances {
|
||||
|
||||
let tail_jump_dist = (stacked_tail_pos - base.stacked_pos()).length() * scaling_factor;
|
||||
|
||||
this.min_jump_dist = (this.lazy_jump_dist
|
||||
- (Self::MAXIMUM_SLIDER_RADIUS - Self::ASSUMED_SLIDER_RADIUS) as f64)
|
||||
.min((tail_jump_dist - Self::MAXIMUM_SLIDER_RADIUS) as f64)
|
||||
.max(0.0);
|
||||
let diff = (Self::MAXIMUM_SLIDER_RADIUS - Self::ASSUMED_SLIDER_RADIUS) as f64;
|
||||
let min = (tail_jump_dist - Self::MAXIMUM_SLIDER_RADIUS) as f64;
|
||||
|
||||
// "attributes on expressions are experimental see issue #15701 https://github.com/rust-lang/rust/issues/15701"
|
||||
// rust pls...
|
||||
#[allow(clippy::manual_clamp)]
|
||||
let tmp = (this.lazy_jump_dist - diff).min(min).max(0.0);
|
||||
this.min_jump_dist = tmp;
|
||||
}
|
||||
|
||||
if let Some(last_last) = last_last.filter(|obj| !obj.is_spinner()) {
|
||||
|
||||
@@ -214,8 +214,7 @@ impl FlashlightEvaluator {
|
||||
let pixel_travel_dist = osu_curr.dists.lazy_travel_dist as f64 / scaling_factor;
|
||||
|
||||
// * Reward sliders based on velocity.
|
||||
slider_bonus = ((pixel_travel_dist / osu_curr.dists.travel_time as f64
|
||||
- Self::MIN_VELOCITY)
|
||||
slider_bonus = ((pixel_travel_dist / osu_curr.dists.travel_time - Self::MIN_VELOCITY)
|
||||
.max(0.0))
|
||||
.sqrt();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ pub(crate) trait StrainSkill: Skill + Sized {
|
||||
) {
|
||||
// * The first object doesn't generate a strain, so we begin with an incremented section end
|
||||
if curr.idx == 0 {
|
||||
let section_len = SECTION_LEN as f64;
|
||||
let section_len = SECTION_LEN;
|
||||
*self.curr_section_end() = (curr.start_time / section_len).ceil() * section_len;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ pub(crate) trait StrainSkill: Skill + Sized {
|
||||
self.start_new_section_from(section_end, curr, diff_objects);
|
||||
}
|
||||
|
||||
*self.curr_section_end() += SECTION_LEN as f64;
|
||||
*self.curr_section_end() += SECTION_LEN;
|
||||
}
|
||||
|
||||
*self.curr_section_peak() = self
|
||||
|
||||
Reference in New Issue
Block a user