diff options
| author | zjp <[email protected]> | 2024-06-09 11:50:32 +0800 |
|---|---|---|
| committer | zjp <[email protected]> | 2024-06-09 11:50:32 +0800 |
| commit | 6b9470be2c3551863387ea5395d605dd8a853132 (patch) | |
| tree | 34929c0d2def986e18636280914b0fde02d0ce1c /embassy-executor | |
| parent | 3f45ec6ead2551b5f6c30ea7c718de26d126fbda (diff) | |
fix warning on unused import
Diffstat (limited to 'embassy-executor')
| -rw-r--r-- | embassy-executor/src/raw/waker.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/embassy-executor/src/raw/waker.rs b/embassy-executor/src/raw/waker.rs index fe64456e1..421ec301e 100644 --- a/embassy-executor/src/raw/waker.rs +++ b/embassy-executor/src/raw/waker.rs | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | use core::mem; | ||
| 2 | use core::task::{RawWaker, RawWakerVTable, Waker}; | 1 | use core::task::{RawWaker, RawWakerVTable, Waker}; |
| 3 | 2 | ||
| 4 | use super::{wake_task, TaskHeader, TaskRef}; | 3 | use super::{wake_task, TaskHeader, TaskRef}; |
| @@ -38,7 +37,7 @@ pub fn task_from_waker(waker: &Waker) -> TaskRef { | |||
| 38 | // This is not really guaranteed because the structs are `repr(Rust)`, it is | 37 | // This is not really guaranteed because the structs are `repr(Rust)`, it is |
| 39 | // indeed the case in the current implementation. | 38 | // indeed the case in the current implementation. |
| 40 | // TODO use waker_getters when stable. https://github.com/rust-lang/rust/issues/96992 | 39 | // TODO use waker_getters when stable. https://github.com/rust-lang/rust/issues/96992 |
| 41 | let hack: &WakerHack = unsafe { mem::transmute(waker) }; | 40 | let hack: &WakerHack = unsafe { core::mem::transmute(waker) }; |
| 42 | if hack.vtable != &VTABLE { | 41 | if hack.vtable != &VTABLE { |
| 43 | panic!("Found waker not created by the Embassy executor. `embassy_time::Timer` only works with the Embassy executor.") | 42 | panic!("Found waker not created by the Embassy executor. `embassy_time::Timer` only works with the Embassy executor.") |
| 44 | } | 43 | } |
