Skip to content

Commit

Permalink
Fix wrong dynamic tween impl pushed
Browse files Browse the repository at this point in the history
  • Loading branch information
Multirious committed Mar 15, 2024
1 parent 645fbc9 commit 82dce0d
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/tween.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,37 +315,37 @@ where
}
}

impl<T, DI> Tween<T, Box<DI>>
where
DI: Interpolator<Item = T::Item> + ?Sized,
T: TweenTarget,
T::Item: 'static,
{
/// Create a new [`Tween`] with a target and an interpolator that will be boxed internally.
pub fn new_target_boxed<G, I>(target: G, interpolator: I) -> Self
where
I: Interpolator<Item = T::Item>,
G: Into<T>,
{
let b: Box<dyn Interpolator<Item = T::Item>> = Box::new(interpolator);
Self::new_target(target, b)
}
}

// impl<T> Tween<T, Box<dyn Interpolator<Item = T::Item>>>
// impl<T, DI> Tween<T, Box<DI>>
// where
// T: TweenTarget + Default,
// DI: Interpolator<Item = T::Item> + ?Sized,
// T: TweenTarget,
// T::Item: 'static,
// {
// /// Create a new [`Tween`] with the default target and an interpolator that will be boxed internally.
// pub fn new_boxed<I>(interpolator: I) -> Self
// /// Create a new [`Tween`] with a target and an interpolator that will be boxed internally.
// pub fn new_target_boxed<G, I>(target: G, interpolator: I) -> Self
// where
// I: Interpolator<Item = T::Item>,
// G: Into<T>,
// {
// Self::new(Box::new(interpolator))
// let b: Box<dyn Interpolator<Item = T::Item>> = Box::new(interpolator);
// Self::new_target(target, b)
// }
// }

impl<T> Tween<T, Box<dyn Interpolator<Item = T::Item>>>
where
T: TweenTarget + Default,
T::Item: 'static,
{
/// Create a new [`Tween`] with the default target and an interpolator that will be boxed internally.
pub fn new_boxed<I>(interpolator: I) -> Self
where
I: Interpolator<Item = T::Item>,
{
Self::new(Box::new(interpolator))
}
}

/// Useful for the implementor to specify what this *target* will return the
/// tweenable [`Self::Item`] which should match [`Interpolator::Item`].
/// See [`TargetComponent`], [`TargetResource`], and [`TargetAsset`].
Expand Down

0 comments on commit 82dce0d

Please sign in to comment.