Skip to content

Commit

Permalink
anim fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nia-e committed Jun 20, 2023
1 parent f358ad0 commit 6333735
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lvgl/src/misc/anim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ 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,
end: i32,
animator: F,
) -> LvResult<Self>
where
T: for<'b> Widget<'b>,
T: Widget<'b>,
F: FnMut(&mut Obj, i32) + 'a,
{
unsafe {
Expand All @@ -49,7 +49,7 @@ impl Animation {
(*anim.raw).end_value = end;
(*anim.raw).user_data = Box::<F>::into_raw(Box::new(animator)) as *mut _;
(*anim.raw).var = target as *mut _ as *mut _;
(*anim.raw).exec_cb = Some(animator_trampoline::<T, F>);
(*anim.raw).exec_cb = Some(animator_trampoline::<'a, 'b, T, F>);

Ok(anim)
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6333735

Please sign in to comment.