feat: enable clippy pedantic and fix

This commit is contained in:
2026-02-15 12:34:36 +01:00
parent 36a2e0e9e2
commit 02ce2097fb
4 changed files with 10 additions and 5 deletions
+4 -1
View File
@@ -23,6 +23,9 @@ pub fn back_in_out(t: f32) -> f32 {
if t < 0.5 {
((2.0 * t).powi(2) * ((C2 + 1.0) * 2.0 * t - C2)) / 2.0
} else {
((2.0 * t - 2.0).powi(2) * ((C2 + 1.0) * (t * 2.0 - 2.0) + C2) + 2.0) / 2.0
f32::midpoint(
(2.0 * t - 2.0).powi(2) * ((C2 + 1.0) * (t * 2.0 - 2.0) + C2),
2.0,
)
}
}
+3 -3
View File
@@ -16,9 +16,9 @@ pub fn bounce_out(t: f32) -> f32 {
} else if t < 2.0 / D1 {
N1 * (t - 1.5 / D1).powi(2) + 0.75
} else if t < 2.5 / D1 {
N1 * (t - 2.25 / D1).powi(2) + 0.9375
N1 * (t - 2.25 / D1).powi(2) + 0.937_5
} else {
N1 * (t - 2.625 / D1).powi(2) + 0.984375
N1 * (t - 2.625 / D1).powi(2) + 0.984_375
}
}
@@ -29,6 +29,6 @@ pub fn bounce_in_out(t: f32) -> f32 {
if t < 0.5 {
(1.0 - bounce_out(1.0 - 2.0 * t)) / 2.0
} else {
(1.0 + bounce_out(2.0 * t - 1.0)) / 2.0
f32::midpoint(1.0, bounce_out(2.0 * t - 1.0))
}
}
+1 -1
View File
@@ -19,6 +19,6 @@ pub fn circ_in_out(t: f32) -> f32 {
if t < 0.5 {
(1.0 - (1.0 - (2.0 * t).powi(2)).sqrt()) / 2.0
} else {
((1.0 - (-2.0 * t + 2.0).powi(2)).sqrt() + 1.0) / 2.0
f32::midpoint((1.0 - (-2.0 * t + 2.0).powi(2)).sqrt(), 1.0)
}
}
+2
View File
@@ -20,6 +20,8 @@
//! assert_eq!(easing(1.0), 1.0);
//! ```
#![warn(clippy::pedantic)]
mod back;
mod bounce;
mod circ;