made clippy happy

This commit is contained in:
MaxOhn
2023-01-11 23:57:04 +01:00
parent 07ea95a6c0
commit 51a2092020
10 changed files with 22 additions and 20 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ impl CatchObject {
*last_excess = half_catcher_width;
} else {
self.hyper_dist = hyper_dist;
*last_excess = (hyper_dist as f64).max(0.0).min(half_catcher_width);
*last_excess = (hyper_dist as f64).clamp(0.0, half_catcher_width);
}
*last_direction = this_direction;
+4 -3
View File
@@ -82,9 +82,10 @@ impl Movement {
.last_player_position
.unwrap_or(current.last_normalized_pos);
let mut pos = last_player_pos
.max(current.normalized_pos - POSITION_EPSILON)
.min(current.normalized_pos + POSITION_EPSILON);
let mut pos = last_player_pos.clamp(
current.normalized_pos - POSITION_EPSILON,
current.normalized_pos + POSITION_EPSILON,
);
let dist_moved = pos - last_player_pos;
let weighted_strain_time = current.strain_time + 13.0 + (3.0 / current.clock_rate);
+1 -3
View File
@@ -431,9 +431,7 @@ impl CatchPPInner {
if total_hits == 0 {
1.0
} else {
(self.successful_hits() as f64 / total_hits as f64)
.max(0.0)
.min(1.0)
(self.successful_hits() as f64 / total_hits as f64).clamp(0.0, 1.0)
}
}
}