From 0347f9e62744612b1f80a0a9ba81030c1143a6a0 Mon Sep 17 00:00:00 2001 From: Waffle Date: Sat, 26 Jun 2021 23:21:44 +0300 Subject: [PATCH] Replace `ShutdownError` with `()` --- src/dispatching/dispatcher.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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, }