Breaking change: Mixin is now consumed, which means it works with FnOnce now

This commit is contained in:
Pauan 2018-07-16 17:26:48 -10:00
parent 34709737c8
commit 59cce2e850
1 changed files with 3 additions and 3 deletions

View File

@ -7,12 +7,12 @@ pub use animation::AnimatedSignalVec;
pub trait Mixin<A> {
fn apply(&self, builder: A) -> A;
fn apply(self, builder: A) -> A;
}
impl<A, F> Mixin<A> for F where F: Fn(A) -> A {
impl<A, F> Mixin<A> for F where F: FnOnce(A) -> A {
#[inline]
fn apply(&self, builder: A) -> A {
fn apply(self, builder: A) -> A {
self(builder)
}
}