Skip to content

Commit 207c005

Browse files
raggicarllerche
authored andcommitted
Oneshot example, switch variable names
The example I think was intending for `p = producer, c = consumer`, but had `p` and `c` roles switched.
1 parent d08392c commit 207c005

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sync/oneshot.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ struct Inner<T> {
8484
/// use futures::sync::oneshot;
8585
/// use futures::*;
8686
///
87-
/// let (c, p) = oneshot::channel::<i32>();
87+
/// let (p, c) = oneshot::channel::<i32>();
8888
///
8989
/// thread::spawn(|| {
90-
/// p.map(|i| {
90+
/// c.map(|i| {
9191
/// println!("got: {}", i);
9292
/// }).wait();
9393
/// });
9494
///
95-
/// c.send(3).unwrap();
95+
/// p.send(3).unwrap();
9696
/// ```
9797
pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
9898
let inner = Arc::new(Inner::new());

0 commit comments

Comments
 (0)