From 19dc1ad59eb27f8684749f28ef78e764be708b39 Mon Sep 17 00:00:00 2001 From: Lucas Kent Date: Wed, 16 Nov 2022 15:15:30 +1100 Subject: [PATCH 1/2] Specify type returned when awaiting a oneshot::Receiver --- tokio/src/sync/oneshot.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tokio/src/sync/oneshot.rs b/tokio/src/sync/oneshot.rs index f5718dc92f8..b610a237399 100644 --- a/tokio/src/sync/oneshot.rs +++ b/tokio/src/sync/oneshot.rs @@ -227,7 +227,7 @@ pub struct Sender { /// [`channel`](fn@channel) function. /// /// This channel has no `recv` method because the receiver itself implements the -/// [`Future`] trait. To receive a value, `.await` the `Receiver` object directly. +/// [`Future`] trait. To receive a `Result`, `.await` the `Receiver` object directly. /// /// The `poll` method on the `Future` trait is allowed to spuriously return /// `Poll::Pending` even if the message has been sent. If such a spurious @@ -331,6 +331,7 @@ pub mod error { use std::fmt; /// Error returned by the `Future` implementation for `Receiver`. + /// This error is returned when the sender is dropped without sending. #[derive(Debug, Eq, PartialEq, Clone)] pub struct RecvError(pub(super) ()); From c21ce326a533d94a1152576a667394419f5a729e Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Wed, 16 Nov 2022 10:05:51 +0100 Subject: [PATCH 2/2] Update tokio/src/sync/oneshot.rs --- tokio/src/sync/oneshot.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tokio/src/sync/oneshot.rs b/tokio/src/sync/oneshot.rs index b610a237399..fcd7a32e8e8 100644 --- a/tokio/src/sync/oneshot.rs +++ b/tokio/src/sync/oneshot.rs @@ -331,7 +331,8 @@ pub mod error { use std::fmt; /// Error returned by the `Future` implementation for `Receiver`. - /// This error is returned when the sender is dropped without sending. + /// + /// This error is returned by the receiver when the sender is dropped without sending. #[derive(Debug, Eq, PartialEq, Clone)] pub struct RecvError(pub(super) ());