Skip to content

Commit 3757f01

Browse files
committed
auto merge of #13610 : jsanders/rust/sender-try-send-docs, r=alexcrichton
I was getting a bit confused by these and (I think) managed to track it down to fallout from #13448 and #13465.
2 parents 3db2b69 + 29c291b commit 3757f01

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libstd/comm/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ impl<T: Send> Sender<T> {
479479
/// then the other end could immediately disconnect.
480480
///
481481
/// The purpose of this functionality is to propagate failure among tasks.
482-
/// If failure is not desired, then consider using the `try_send` method
482+
/// If failure is not desired, then consider using the `send_opt` method
483483
pub fn send(&self, t: T) {
484484
if self.send_opt(t).is_err() {
485485
fail!("sending on a closed channel");
@@ -669,10 +669,10 @@ impl<T: Send> SyncSender<T> {
669669

670670
/// Attempts to send a value on this channel without blocking.
671671
///
672-
/// This method semantically differs from `Sender::try_send` because it can
673-
/// fail if the receiver has not disconnected yet. If the buffer on this
674-
/// channel is full, this function will immediately return the data back to
675-
/// the callee.
672+
/// This method differs from `send_opt` by returning immediately if the
673+
/// channel's buffer is full or no receiver is waiting to acquire some
674+
/// data. Compared with `send_opt`, this function has two failure cases
675+
/// instead of one (one for disconnection, one for a full buffer).
676676
///
677677
/// See `SyncSender::send` for notes about guarantees of whether the
678678
/// receiver has received the data or not if this function is successful.

0 commit comments

Comments
 (0)