From cbc1ecd53eb0de92e009e58496e779a65b6e4427 Mon Sep 17 00:00:00 2001 From: Ruediger Klaehn Date: Mon, 1 Sep 2025 12:07:47 +0200 Subject: [PATCH] Do not require &mut self for try_send That is probably a leftover from when we made Sender Clone. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index b7406d5..9491472 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -712,7 +712,7 @@ pub mod channel { /// then the sender will be closed and further sends will return an [`SendError::Io`] /// with [`std::io::ErrorKind::BrokenPipe`]. Therefore, make sure to always poll the /// future until completion if you want to reuse the sender or any clone afterwards. - pub async fn try_send(&mut self, value: T) -> std::result::Result { + pub async fn try_send(&self, value: T) -> std::result::Result { match self { Sender::Tokio(tx) => match tx.try_send(value) { Ok(()) => Ok(true),