fix warning on unused import

This commit is contained in:
zjp 2024-06-09 11:50:32 +08:00
parent 3f45ec6ead
commit 6b9470be2c

View file

@ -1,4 +1,3 @@
use core::mem;
use core::task::{RawWaker, RawWakerVTable, Waker};
use super::{wake_task, TaskHeader, TaskRef};
@ -38,7 +37,7 @@ pub fn task_from_waker(waker: &Waker) -> TaskRef {
// This is not really guaranteed because the structs are `repr(Rust)`, it is
// indeed the case in the current implementation.
// TODO use waker_getters when stable. https://github.com/rust-lang/rust/issues/96992
let hack: &WakerHack = unsafe { mem::transmute(waker) };
let hack: &WakerHack = unsafe { core::mem::transmute(waker) };
if hack.vtable != &VTABLE {
panic!("Found waker not created by the Embassy executor. `embassy_time::Timer` only works with the Embassy executor.")
}