feat: enable clippy nursery and fix
This commit is contained in:
+4
-4
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user