You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-26 18:51:00 +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:
@ -21,3 +21,9 @@ fn main() {
|
|||||||
println!("Received: {:?}", rx.recv());
|
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>
|
||||||
|
Reference in New Issue
Block a user