From 63337351b72b35063ecaa62fbcc57cd79260fd02 Mon Sep 17 00:00:00 2001 From: Nia Espera Date: Tue, 20 Jun 2023 18:54:19 +0200 Subject: [PATCH] anim fmt --- lvgl/src/misc/anim.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lvgl/src/misc/anim.rs b/lvgl/src/misc/anim.rs index daafb37a..1ca00da5 100644 --- a/lvgl/src/misc/anim.rs +++ b/lvgl/src/misc/anim.rs @@ -21,7 +21,7 @@ pub struct Animation { impl Animation { /// Instantiates an `Animation` with the required attributes. - pub fn new<'a, T, F>( + pub fn new<'a, 'b, T, F>( target: &mut T, duration: Duration, start: i32, @@ -29,7 +29,7 @@ impl Animation { animator: F, ) -> LvResult where - T: for<'b> Widget<'b>, + T: Widget<'b>, F: FnMut(&mut Obj, i32) + 'a, { unsafe { @@ -49,7 +49,7 @@ impl Animation { (*anim.raw).end_value = end; (*anim.raw).user_data = Box::::into_raw(Box::new(animator)) as *mut _; (*anim.raw).var = target as *mut _ as *mut _; - (*anim.raw).exec_cb = Some(animator_trampoline::); + (*anim.raw).exec_cb = Some(animator_trampoline::<'a, 'b, T, F>); Ok(anim) } @@ -104,9 +104,9 @@ impl Animation { } } -unsafe extern "C" fn animator_trampoline<'a, T, F>(obj: *mut c_void, val: i32) +unsafe extern "C" fn animator_trampoline<'a, 'b, T, F>(obj: *mut c_void, val: i32) where - T: for<'b> Widget<'b>, + T: Widget<'b>, F: FnMut(&mut Obj, i32) + 'a, { unsafe {