mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
sync: make downgrade must_use (#6326)
This commit is contained in:
parent
63caced26f
commit
fbdf539ac2
@ -1367,6 +1367,7 @@ impl<T> Sender<T> {
|
||||
/// towards RAII semantics, i.e. if all `Sender` instances of the
|
||||
/// channel were dropped and only `WeakSender` instances remain,
|
||||
/// the channel is closed.
|
||||
#[must_use = "Downgrade creates a WeakSender without destroying the original non-weak sender."]
|
||||
pub fn downgrade(&self) -> WeakSender<T> {
|
||||
WeakSender {
|
||||
chan: self.chan.downgrade(),
|
||||
|
@ -572,6 +572,7 @@ impl<T> UnboundedSender<T> {
|
||||
/// towards RAII semantics, i.e. if all `UnboundedSender` instances of the
|
||||
/// channel were dropped and only `WeakUnboundedSender` instances remain,
|
||||
/// the channel is closed.
|
||||
#[must_use = "Downgrade creates a WeakSender without destroying the original non-weak sender."]
|
||||
pub fn downgrade(&self) -> WeakUnboundedSender<T> {
|
||||
WeakUnboundedSender {
|
||||
chan: self.chan.downgrade(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user