Skip to content

Commit

Permalink
Fix timer callback type
Browse files Browse the repository at this point in the history
- Closes #1166
- `TimerCallback` has type: `Box<dyn FnMut() -> u32 + 'a + Send>`
  • Loading branch information
parasyte committed Dec 1, 2021
1 parent fe411c6 commit 7b97dfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sdl2/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<'b, 'a> Drop for Timer<'b, 'a> {
}

extern "C" fn c_timer_callback(_interval: u32, param: *mut c_void) -> u32 {
let f = param as *mut std::boxed::Box<dyn std::ops::Fn() -> u32>;
let f = param as *mut TimerCallback<'_>;
unsafe { (*f)() }
}

Expand Down

0 comments on commit 7b97dfd

Please sign in to comment.