diff options
author | Alice Ryhl <alice@ryhl.io> | 2020-10-02 06:13:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 21:13:28 -0700 |
commit | 7ec6d88b21ea3e5531176f526a51dae0a4513025 (patch) | |
tree | 6b4f289567fce7033551910c684c8358da4a58d8 /tokio/tests/sync_oneshot.rs | |
parent | 13de30c53eb90a5453f1cecf47b188e254a293ac (diff) |
chore: make #[doc(hidden)] apis private (#2901)
Diffstat (limited to 'tokio/tests/sync_oneshot.rs')
-rw-r--r-- | tokio/tests/sync_oneshot.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tokio/tests/sync_oneshot.rs b/tokio/tests/sync_oneshot.rs index 13e526d4..195c2553 100644 --- a/tokio/tests/sync_oneshot.rs +++ b/tokio/tests/sync_oneshot.rs @@ -6,11 +6,24 @@ use tokio_test::*; use std::future::Future; use std::pin::Pin; +use std::task::{Context, Poll}; trait AssertSend: Send {} impl AssertSend for oneshot::Sender<i32> {} impl AssertSend for oneshot::Receiver<i32> {} +trait SenderExt { + fn poll_closed(&mut self, cx: &mut Context<'_>) -> Poll<()>; +} +impl<T> SenderExt for oneshot::Sender<T> { + fn poll_closed(&mut self, cx: &mut Context<'_>) -> Poll<()> { + tokio::pin! { + let fut = self.closed(); + } + fut.poll(cx) + } +} + #[test] fn send_recv() { let (tx, rx) = oneshot::channel(); |