feat: enable clippy nursery and fix

This commit is contained in:
2026-02-15 12:47:52 +01:00
parent ca0c3ab892
commit b50c5c2a41
10 changed files with 36 additions and 27 deletions
+4 -4
View File
@@ -6,14 +6,14 @@ const C3: f32 = C1 + 1.0;
#[inline]
#[must_use]
pub fn back_in(t: f32) -> f32 {
C3 * t * t * t - C1 * t * t
(C3 * t * t).mul_add(t, -(C1 * t * t))
}
/// <https://easings.net/#easeOutBack>
#[inline]
#[must_use]
pub fn back_out(t: f32) -> f32 {
1.0 + C3 * (t - 1.0).powi(3) + C1 * (t - 1.0).powi(2)
C1.mul_add((t - 1.0).powi(2), C3.mul_add((t - 1.0).powi(3), 1.0))
}
/// <https://easings.net/#easeInOutBack>
@@ -21,10 +21,10 @@ pub fn back_out(t: f32) -> f32 {
#[must_use]
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
((2.0 * t).powi(2) * ((C2 + 1.0) * 2.0).mul_add(t, -C2)) / 2.0
} else {
f32::midpoint(
(2.0 * t - 2.0).powi(2) * ((C2 + 1.0) * (t * 2.0 - 2.0) + C2),
2.0f32.mul_add(t, -2.0).powi(2) * (C2 + 1.0).mul_add(t.mul_add(2.0, -2.0), C2),
2.0,
)
}