diff --git a/src/interpolate.rs b/src/interpolate.rs index 1971ad3..1bc0fac 100644 --- a/src/interpolate.rs +++ b/src/interpolate.rs @@ -105,26 +105,6 @@ pub trait Interpolator: Send + Sync + 'static { fn interpolate(&self, item: &mut Self::Item, value: f32); } -impl Interpolator - for Box -{ - type Item = I; - - fn interpolate(&self, item: &mut Self::Item, value: f32) { - self(item, value) - } -} - -impl Interpolator - for &'static (dyn Fn(&mut I, f32) + Send + Sync + 'static) -{ - type Item = I; - - fn interpolate(&self, item: &mut Self::Item, value: f32) { - self(item, value) - } -} - impl Interpolator for Box where I: Interpolator + ?Sized, @@ -158,6 +138,14 @@ where } } +impl Interpolator for dyn Fn(&mut I, f32) + Send + Sync + 'static { + type Item = I; + + fn interpolate(&self, item: &mut Self::Item, value: f32) { + self(item, value) + } +} + /// Default interpolators pub struct DefaultInterpolatorsPlugin; impl Plugin for DefaultInterpolatorsPlugin {