summaryrefslogtreecommitdiffstats
path: root/tokio/src/time/timeout.rs
diff options
context:
space:
mode:
authorJuan Alvarez <j@yabit.io>2020-10-08 22:35:12 -0500
committerGitHub <noreply@github.com>2020-10-08 20:35:12 -0700
commit60d81bbe10faf344ea18438a1c5ecb9173e6ec52 (patch)
tree4a6b64401944b62ffa872147e5738eb28e70d4ec /tokio/src/time/timeout.rs
parentb704c53b9cc76eaf8c9c6585f8444c4515d27728 (diff)
time: rename `Delay` future to `Sleep` (#2932)
Diffstat (limited to 'tokio/src/time/timeout.rs')
-rw-r--r--tokio/src/time/timeout.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/tokio/src/time/timeout.rs b/tokio/src/time/timeout.rs
index 0804f265..d35121ac 100644
--- a/tokio/src/time/timeout.rs
+++ b/tokio/src/time/timeout.rs
@@ -4,7 +4,7 @@
//!
//! [`Timeout`]: struct@Timeout
-use crate::time::{sleep_until, Delay, Duration, Instant};
+use crate::time::{sleep_until, Duration, Instant, Sleep};
use pin_project_lite::pin_project;
use std::fmt;
@@ -50,7 +50,7 @@ pub fn timeout<T>(duration: Duration, future: T) -> Timeout<T>
where
T: Future,
{
- let delay = Delay::new_timeout(Instant::now() + duration, duration);
+ let delay = Sleep::new_timeout(Instant::now() + duration, duration);
Timeout::new_with_delay(future, delay)
}
@@ -108,7 +108,7 @@ pin_project! {
#[pin]
value: T,
#[pin]
- delay: Delay,
+ delay: Sleep,
}
}
@@ -125,7 +125,7 @@ impl Elapsed {
}
impl<T> Timeout<T> {
- pub(crate) fn new_with_delay(value: T, delay: Delay) -> Timeout<T> {
+ pub(crate) fn new_with_delay(value: T, delay: Sleep) -> Timeout<T> {
Timeout { value, delay }
}