From 4968f59af61245cdc2f795d4134fd8e91edeaa6f Mon Sep 17 00:00:00 2001 From: vitalyd Date: Thu, 28 Jan 2021 04:31:23 -0500 Subject: [PATCH] sync: update Sender::try_reserve doc (#3476) --- tokio/src/sync/mpsc/bounded.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tokio/src/sync/mpsc/bounded.rs b/tokio/src/sync/mpsc/bounded.rs index 0813ce2f9..dfe4a749b 100644 --- a/tokio/src/sync/mpsc/bounded.rs +++ b/tokio/src/sync/mpsc/bounded.rs @@ -22,10 +22,11 @@ pub struct Sender { /// Permit to send one value into the channel. /// -/// `Permit` values are returned by [`Sender::reserve()`] and are used to -/// guarantee channel capacity before generating a message to send. +/// `Permit` values are returned by [`Sender::reserve()`] and [`Sender::try_reserve()`] +/// and are used to guarantee channel capacity before generating a message to send. /// /// [`Sender::reserve()`]: Sender::reserve +/// [`Sender::try_reserve()`]: Sender::try_reserve pub struct Permit<'a, T> { chan: &'a chan::Tx, } @@ -652,7 +653,7 @@ impl Sender { /// If the channel is full this function will return [`TrySendError`], otherwise /// if there is a slot available it will return a [`Permit`] that will then allow you /// to [`send`] on the channel with a guaranteed slot. This function is similar to - /// [`reserve`] execpt it does not await for the slot to become available. + /// [`reserve`] except it does not await for the slot to become available. /// /// Dropping [`Permit`] without sending a message releases the capacity back /// to the channel.