mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 18:40:57 +03:00
Fix warnings in examples
This commit is contained in:
@@ -425,15 +425,15 @@ pub fn spawn<F, T>(self, f: F) -> io::Result<JoinHandle<T>> where
|
||||
/// let (tx, rx) = channel();
|
||||
///
|
||||
/// let sender = thread::spawn(move || {
|
||||
/// tx.send("Hello, thread".to_owned());
|
||||
/// let _ = tx.send("Hello, thread".to_owned());
|
||||
/// });
|
||||
///
|
||||
/// let receiver = thread::spawn(move || {
|
||||
/// println!("{}", rx.recv().unwrap());
|
||||
/// });
|
||||
///
|
||||
/// sender.join();
|
||||
/// receiver.join();
|
||||
/// let _ = sender.join();
|
||||
/// let _ = receiver.join();
|
||||
/// ```
|
||||
///
|
||||
/// A thread can also return a value through its [`JoinHandle`], you can use
|
||||
@@ -449,7 +449,7 @@ pub fn spawn<F, T>(self, f: F) -> io::Result<JoinHandle<T>> where
|
||||
/// });
|
||||
///
|
||||
/// let result = computation.join().unwrap();
|
||||
/// println!("{}", v);
|
||||
/// println!("{}", result);
|
||||
/// ```
|
||||
///
|
||||
/// [`channels`]: ../../std/sync/mpsc/index.html
|
||||
|
||||
Reference in New Issue
Block a user