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:
parent
617f4e2bb7
commit
178d7104e6
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user