• Y
    Rollup merge of #80269 - pickfire:patch-4, r=joshtriplett · 2d2f1a5e
    Yuki Okushi 提交于
    Explain non-dropped sender recv in docs
    
    Original senders that are still hanging around could cause
    Receiver::recv to not block since this is a potential footgun
    for beginners, clarify more on this in the docs for readers to
    be aware about it.
    
    Maybe it would be better to show an example of the pattern where `drop(tx)` is used when it is being cloned multiple times? Although I have seen it in quite a few articles but I am surprised that this part is not very clear with the current words without careful reading.
    
    > If the corresponding Sender has disconnected, or it disconnects while this call is blocking, this call will wake up and return Err to indicate that no more messages can ever be received on this channel. However, since channels are buffered, messages sent before the disconnect will still be properly received.
    
    Some words there may seemed similar if I carefully read and relate it but if I am new, I probably does not know "drop" makes it "disconnected". So I mention the words "drop" and "alive" to make it more relatable to lifetime.
    2d2f1a5e
mod.rs 56.6 KB