From 7bf31f95af1905880e73a169b0eb3894597e6f0f Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Thu, 13 Aug 2020 03:09:54 -0500 Subject: [PATCH] Fix mutability of buffers for a few send_* functions (#92) --- src/socket.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/socket.rs b/src/socket.rs index ebe3f60d..f9fd19ce 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -318,7 +318,7 @@ impl Socket { /// `send` call. /// /// [`send`]: #method.send - pub fn send_with_flags(&self, buf: &mut [u8], flags: i32) -> io::Result { + pub fn send_with_flags(&self, buf: &[u8], flags: i32) -> io::Result { self.inner.send(buf, flags) } @@ -330,7 +330,7 @@ impl Socket { /// [`send`]: #method.send /// [`out_of_band_inline`]: #method.out_of_band_inline #[cfg(all(feature = "all", not(target_os = "redox")))] - pub fn send_out_of_band(&self, buf: &mut [u8]) -> io::Result { + pub fn send_out_of_band(&self, buf: &[u8]) -> io::Result { self.inner.send(buf, MSG_OOB) }