From e1c70a31c8c6940d61683440683ceebc8a320211 Mon Sep 17 00:00:00 2001 From: mianlang Date: Sat, 22 Mar 2025 00:49:03 +0800 Subject: [PATCH] refactor 16-6 to using listing component --- src/ch16-02-message-passing.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ch16-02-message-passing.md b/src/ch16-02-message-passing.md index 7f723e7986..99ff2fcfdb 100644 --- a/src/ch16-02-message-passing.md +++ b/src/ch16-02-message-passing.md @@ -32,14 +32,13 @@ First, in Listing 16-6, we’ll create a channel but not do anything with it. Note that this won’t compile yet because Rust can’t tell what type of values we want to send over the channel. -Filename: src/main.rs + ```rust,ignore,does_not_compile {{#rustdoc_include ../listings/ch16-fearless-concurrency/listing-16-06/src/main.rs}} ``` -Listing 16-6: Creating a channel and assigning the two -halves to `tx` and `rx` + We create a new channel using the `mpsc::channel` function; `mpsc` stands for _multiple producer, single consumer_. In short, the way Rust’s standard library