mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
timer: Replace Handle::deadline with Handle::timeout (#1074)
Deadline was deprecated a while ago and replaced with Timeout, but the methods on Handle got missed. Fixes #1071
This commit is contained in:
committed by
Carl Lerche
parent
ea282efb2e
commit
219f24cbf1
@@ -126,7 +126,10 @@ impl<T> Timeout<T> {
|
||||
/// ```
|
||||
pub fn new(value: T, timeout: Duration) -> Timeout<T> {
|
||||
let delay = Delay::new_timeout(now() + timeout, timeout);
|
||||
Timeout::new_with_delay(value, delay)
|
||||
}
|
||||
|
||||
pub(crate) fn new_with_delay(value: T, delay: Delay) -> Timeout<T> {
|
||||
Timeout { value, delay }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user