From b9dc4c900864ce3305828279128ee7162cf520eb Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Fri, 8 Sep 2017 22:31:37 -0700 Subject: [PATCH] TokenTimeout: add doc around new panic My slab bump in #246 added a potential new panic in Core's Inner's `cancel_timeout`. Thankfully, the only way `cancel_timeout` can be called is from TimeoutToken's `cancel_timeout`, which is crate-internal only and is only called from Timeout's and Interval's drop fn's. This change simply adds new clarifying documentation around TokenTimeout's cancel_timeout to "future proof" anybody looking to use cancel_timeout directly (not just on drop). --- src/reactor/timeout_token.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reactor/timeout_token.rs b/src/reactor/timeout_token.rs index 5c086216e..9b6e5feb1 100644 --- a/src/reactor/timeout_token.rs +++ b/src/reactor/timeout_token.rs @@ -48,7 +48,7 @@ impl TimeoutToken { /// # Panics /// /// This method will panic if the timeout specified was not created by this - /// loop handle's `add_timeout` method. + /// loop handle's `add_timeout` method or if called multiple times. pub fn cancel_timeout(&self, handle: &Remote) { debug!("cancel timeout {}", self.token); handle.send(Message::CancelTimeout(self.token))