]> git.lizzy.rs Git - rust.git/commitdiff
Rewrite paragraph describing difference between try_send and send_opt
authorJames Sanders <sanderjd@gmail.com>
Sat, 19 Apr 2014 16:23:15 +0000 (10:23 -0600)
committerJames Sanders <sanderjd@gmail.com>
Sat, 19 Apr 2014 16:23:15 +0000 (10:23 -0600)
src/libstd/comm/mod.rs

index 901a9051d0aca83b717b3b9929026b64db13291c..ce1c09af07cad6a4e1ef2f675e81c44e87d8aa68 100644 (file)
@@ -669,10 +669,10 @@ pub fn send_opt(&self, t: T) -> Result<(), T> {
 
     /// Attempts to send a value on this channel without blocking.
     ///
-    /// This method semantically differs from `Sender::send_opt` because it can
-    /// fail if the receiver has not disconnected yet. If the buffer on this
-    /// channel is full, this function will immediately return the data back to
-    /// the callee.
+    /// This method differs from `send_opt` by returning immediately if the
+    /// channel's buffer is full or no receiver is waiting to acquire some
+    /// data. Compared with `send_opt`, this function has two failure cases
+    /// instead of one (one for disconnection, one for a full buffer).
     ///
     /// See `SyncSender::send` for notes about guarantees of whether the
     /// receiver has received the data or not if this function is successful.