1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-26 01:04:35 +02:00

Update channels.md (#254)

* Update channels.md

Adding speaker notes explaining why `send` and `recv` can fail.

* Explicitly mention that the channel is closed when the sender/receiver is dropped

Co-authored-by: Martin Geisler <martin@geisler.net>
This commit is contained in:
Igor Petruk 2023-01-24 08:35:48 +00:00 committed by GitHub
parent 617f4e2bb7
commit 178d7104e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,3 +21,9 @@ fn main() {
println!("Received: {:?}", rx.recv());
}
```
<details>
* `send()` and `recv()` return `Result`. If they return `Err`, it means the counterpart `Sender` or `Receiver` is dropped and the channel is closed.
</details>