diff --git a/src/lib.rs b/src/lib.rs index b8b6e6b..e6123a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1248,7 +1248,7 @@ impl RegisterResult { match self { Self::Notified(tag) => Some(tag), Self::Registered => None, - Self::NeverInserted => panic!("listener was never inserted into the list"), + Self::NeverInserted => panic!("{}", NEVER_INSERTED_PANIC), } } } @@ -1326,6 +1326,10 @@ impl TaskRef<'_> { } } +const NEVER_INSERTED_PANIC: &str = "\ +EventListener was not inserted into the linked list, make sure you're not polling \ +EventListener/listener! after it has finished"; + /// Synchronization primitive implementation. mod sync { pub(super) use core::cell;