Remove more extra spaces
This commit is contained in:
committed by
Nathan Stocks
parent
5c0dfcda33
commit
c100b83038
@@ -80,7 +80,7 @@ fn main() {
|
|||||||
|
|
||||||
// Using a Receiver channel as an iterator is a convenient way to get values until the channel
|
// Using a Receiver channel as an iterator is a convenient way to get values until the channel
|
||||||
// gets closed. A Receiver channel is automatically closed once all Sender channels have been
|
// gets closed. A Receiver channel is automatically closed once all Sender channels have been
|
||||||
// closed. Both our threads automatically close their Sender channels when they exit and the
|
// closed. Both our threads automatically close their Sender channels when they exit and the
|
||||||
// destructors for the channels get automatically called.
|
// destructors for the channels get automatically called.
|
||||||
for msg in rx {
|
for msg in rx {
|
||||||
println!("Main thread: Received {}", msg);
|
println!("Main thread: Received {}", msg);
|
||||||
@@ -90,10 +90,10 @@ fn main() {
|
|||||||
// - Use the thread handles to join both threads without getting any compiler warnings.
|
// - Use the thread handles to join both threads without getting any compiler warnings.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Challenge: Make two child threads and give them each a receiving end to a channel. From the
|
// Challenge: Make two child threads and give them each a receiving end to a channel. From the
|
||||||
// main thread loop through several values and print each out and then send it to the channel.
|
// main thread loop through several values and print each out and then send it to the channel.
|
||||||
// On the child threads print out the values you receive. Close the sending side in the main
|
// On the child threads print out the values you receive. Close the sending side in the main
|
||||||
// thread by calling `drop(tx)` (assuming you named your sender channel variable `tx`). Join
|
// thread by calling `drop(tx)` (assuming you named your sender channel variable `tx`). Join
|
||||||
// the child threads.
|
// the child threads.
|
||||||
println!("Main thread: Exiting.")
|
println!("Main thread: Exiting.")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user