Skip to content

Commit 18d6eef

Browse files
committed
auto merge of #16761 : mrmonday/rust/patch-1, r=alexcrichton
This question comes up relatively frequently on IRC - "what do tx and rx mean?". This change adds a short explanation.
2 parents 9669c6d + c56aa8b commit 18d6eef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libsync/comm/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
//!
8787
//! ```
8888
//! // Create a shared channel which can be sent along from many tasks
89+
//! // where tx is the sending half (tx for transmission), and rx is the receiving
90+
//! // half (rx for receiving).
8991
//! let (tx, rx) = channel();
9092
//! for i in range(0i, 10i) {
9193
//! let tx = tx.clone();
@@ -473,6 +475,8 @@ impl<T> UnsafeFlavor<T> for Receiver<T> {
473475
/// # Example
474476
///
475477
/// ```
478+
/// // tx is is the sending half (tx for transmission), and rx is the receiving
479+
/// // half (rx for receiving).
476480
/// let (tx, rx) = channel();
477481
///
478482
/// // Spawn off an expensive computation

0 commit comments

Comments
 (0)