Skip to content

Commit ab4f442

Browse files
committed
Fix styling issues
1 parent dab8e81 commit ab4f442

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/libstd/sync/mpsc/mod.rs

+17-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
//!
2424
//! These channels come in two flavors:
2525
//!
26-
//! 1. An asynchronous, infinitely buffered channel. The [`channel()`] function
26+
//! 1. An asynchronous, infinitely buffered channel. The [`channel`] function
2727
//! will return a `(Sender, Receiver)` tuple where all sends will be
2828
//! **asynchronous** (they never block). The channel conceptually has an
2929
//! infinite buffer.
3030
//!
31-
//! 2. A synchronous, bounded channel. The [`sync_channel()`] function will
31+
//! 2. A synchronous, bounded channel. The [`sync_channel`] function will
3232
//! return a `(SyncSender, Receiver)` tuple where the storage for pending
3333
//! messages is a pre-allocated buffer of a fixed size. All sends will be
3434
//! **synchronous** by blocking until there is buffer space available. Note
@@ -39,8 +39,8 @@
3939
//! [`SyncSender`]: ../../../std/sync/mpsc/struct.SyncSender.html
4040
//! [`Receiver`]: ../../../std/sync/mpsc/struct.Receiver.html
4141
//! [`send`]: ../../../std/sync/mpsc/struct.Sender.html#method.send
42-
//! [`channel()`]: ../../../std/sync/mpsc/fn.channel.html
43-
//! [`sync_channel()`]: ../../../std/sync/mpsc/fn.sync_channel.html
42+
//! [`channel`]: ../../../std/sync/mpsc/fn.channel.html
43+
//! [`sync_channel`]: ../../../std/sync/mpsc/fn.sync_channel.html
4444
//!
4545
//! ## Disconnection
4646
//!
@@ -51,12 +51,12 @@
5151
//!
5252
//! Once half of a channel has been deallocated, most operations can no longer
5353
//! continue to make progress, so [`Err`] will be returned. Many applications
54-
//! will continue to [`unwrap()`] the results returned from this module,
54+
//! will continue to [`unwrap`] the results returned from this module,
5555
//! instigating a propagation of failure among threads if one unexpectedly dies.
5656
//!
5757
//! [`Result`]: ../../../std/result/enum.Result.html
5858
//! [`Err`]: ../../../std/result/enum.Result.html#variant.Err
59-
//! [`unwrap()`]: ../../../std/result/enum.Result.html#method.unwrap
59+
//! [`unwrap`]: ../../../std/result/enum.Result.html#method.unwrap
6060
//!
6161
//! # Examples
6262
//!
@@ -310,12 +310,15 @@ mod spsc_queue;
310310
/// use std::sync::mpsc::channel;
311311
/// use std::thread;
312312
/// use std::time::Duration;
313+
///
313314
/// let (send, recv) = channel();
315+
///
314316
/// thread::spawn(move || {
315317
/// send.send("Hello world!").unwrap();
316318
/// thread::sleep(Duration::from_secs(2)); // block for two seconds
317319
/// send.send("Delayed for 2 seconds").unwrap();
318320
/// });
321+
///
319322
/// println!("{}", recv.recv().unwrap()); // Received immediately
320323
/// println!("Waiting...");
321324
/// println!("{}", recv.recv().unwrap()); // Received after 2 seconds
@@ -384,18 +387,23 @@ pub struct IntoIter<T> {
384387
/// ```rust
385388
/// use std::sync::mpsc::channel;
386389
/// use std::thread;
390+
///
387391
/// let (sender, receiver) = channel();
388392
/// let sender2 = sender.clone();
393+
///
389394
/// // First thread owns sender
390395
/// thread::spawn(move || {
391396
/// sender.send(1).unwrap();
392397
/// });
398+
///
393399
/// // Second thread owns sender2
394400
/// thread::spawn(move || {
395401
/// sender2.send(2).unwrap();
396402
/// });
403+
///
397404
/// let msg = receiver.recv().unwrap();
398405
/// let msg2 = receiver.recv().unwrap();
406+
///
399407
/// assert_eq!(3, msg + msg2);
400408
/// ```
401409
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1097,12 +1105,15 @@ impl<T> Receiver<T> {
10971105
/// ```rust
10981106
/// use std::sync::mpsc::channel;
10991107
/// use std::thread;
1108+
///
11001109
/// let (send, recv) = channel();
1110+
///
11011111
/// thread::spawn(move || {
11021112
/// send.send(1u8).unwrap();
11031113
/// send.send(2u8).unwrap();
11041114
/// send.send(3u8).unwrap();
11051115
/// });
1116+
///
11061117
/// for x in recv.iter() {
11071118
/// println!("Got: {}", x);
11081119
/// }

0 commit comments

Comments
 (0)