From ae6319639fe3730b79652b5ece239aa4b52d1c3c Mon Sep 17 00:00:00 2001 From: JohnTheCoolingFan Date: Sat, 2 Dec 2023 10:33:24 +0300 Subject: [PATCH] Make Point trait impl a blanket impl --- crates/bevy_math/src/cubic_splines.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/crates/bevy_math/src/cubic_splines.rs b/crates/bevy_math/src/cubic_splines.rs index 9ab40cca42090..9e5df0e49fc49 100644 --- a/crates/bevy_math/src/cubic_splines.rs +++ b/crates/bevy_math/src/cubic_splines.rs @@ -23,10 +23,20 @@ pub trait Point: + Copy { } -impl Point for Vec3 {} -impl Point for Vec3A {} -impl Point for Vec2 {} -impl Point for f32 {} + +impl Point for T where + T: Mul + + Add + + Sub + + Add + + Sum + + Default + + Debug + + Clone + + PartialEq + + Copy +{ +} /// A spline composed of a single cubic Bezier curve. ///