diff --git a/src/dispatching/dispatcher.rs b/src/dispatching/dispatcher.rs index 6a94258b..763c2c2e 100644 --- a/src/dispatching/dispatcher.rs +++ b/src/dispatching/dispatcher.rs @@ -468,22 +468,15 @@ pub struct ShutdownToken { impl ShutdownToken { /// Tries to shutdown dispatching. /// - /// Returns error if this dispather isn't dispatching at the moment. + /// Returns error if this dispather is idle at the moment. /// /// If you don't need to wait for shutdown, returned future can be ignored. - pub fn shutdown(&self) -> Result + '_, ShutdownError> { + pub fn shutdown(&self) -> Result + '_, ()> { shutdown_inner(&self.dispatcher_state) .map(|()| async move { self.shutdown_notify_back.notified().await }) } } -/// Error occured while trying to shutdown dispatcher. -#[derive(Debug)] -pub enum ShutdownError { - /// Couldn"t stop dispatcher since it wasn't running. - Idle, -} - struct DispatcherState { inner: AtomicU8, }