time_driver: use regular fn ptr -> raw ptr casts

This commit is contained in:
Dario Nieuwenhuis 2021-08-05 19:19:47 +02:00
parent b1d631d639
commit 05e50e1f4a
2 changed files with 2 additions and 8 deletions

View file

@ -208,10 +208,7 @@ impl State {
critical_section::with(|cs| {
let alarm = self.get_alarm(cs, alarm);
// safety: it's OK to transmute a fn pointer into a raw pointer
let callback_ptr: *const () = unsafe { mem::transmute(callback) };
alarm.callback.set(callback_ptr);
alarm.callback.set(callback as *const ());
alarm.ctx.set(ctx);
})
}

View file

@ -232,10 +232,7 @@ impl State {
critical_section::with(|cs| {
let alarm = self.get_alarm(cs, alarm);
// safety: it's OK to transmute a fn pointer into a raw pointer
let callback_ptr: *const () = unsafe { mem::transmute(callback) };
alarm.callback.set(callback_ptr);
alarm.callback.set(callback as *const ());
alarm.ctx.set(ctx);
})
}