about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBenoît du Garreau <bdgdlm@outlook.com>2023-03-02 11:50:27 +0100
committerBenoît du Garreau <bdgdlm@outlook.com>2023-03-02 11:50:27 +0100
commit1e63f08c85d7bc2fb9cf2fad21d6d17359b0be15 (patch)
tree06b61ab9feae78e2d2778473d20913a226b6461d
parent2fc23c2dfe664850231f1691ef56cde6e467aa6a (diff)
downloadrust-1e63f08c85d7bc2fb9cf2fad21d6d17359b0be15.tar.gz
rust-1e63f08c85d7bc2fb9cf2fad21d6d17359b0be15.zip
Take shared references as parameter
-rw-r--r--library/std/src/os/unix/fs.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/library/std/src/os/unix/fs.rs b/library/std/src/os/unix/fs.rs
index edd77c824ad..2915dc56bfc 100644
--- a/library/std/src/os/unix/fs.rs
+++ b/library/std/src/os/unix/fs.rs
@@ -60,11 +60,7 @@ pub trait FileExt {
     /// written to possibly being only partially filled. This method must behave
     /// equivalently to a single call to read with concatenated buffers.
     #[unstable(feature = "unix_file_vectored_at", issue = "89517")]
-    fn read_vectored_at(
-        &mut self,
-        bufs: &mut [io::IoSliceMut<'_>],
-        offset: u64,
-    ) -> io::Result<usize> {
+    fn read_vectored_at(&self, bufs: &mut [io::IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
         io::default_read_vectored(|b| self.read_at(b, offset), bufs)
     }
 
@@ -175,7 +171,7 @@ pub trait FileExt {
     /// from possibly being only partially consumed. This method must behave as
     /// a call to `write_at` with the buffers concatenated would.
     #[unstable(feature = "unix_file_vectored_at", issue = "89517")]
-    fn write_vectored_at(&mut self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
+    fn write_vectored_at(&self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
         io::default_write_vectored(|b| self.write_at(b, offset), bufs)
     }
 
@@ -242,17 +238,13 @@ impl FileExt for fs::File {
     fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
         self.as_inner().read_at(buf, offset)
     }
-    fn read_vectored_at(
-        &mut self,
-        bufs: &mut [io::IoSliceMut<'_>],
-        offset: u64,
-    ) -> io::Result<usize> {
+    fn read_vectored_at(&self, bufs: &mut [io::IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
         self.as_inner().read_vectored_at(bufs, offset)
     }
     fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
         self.as_inner().write_at(buf, offset)
     }
-    fn write_vectored_at(&mut self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
+    fn write_vectored_at(&self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
         self.as_inner().write_vectored_at(bufs, offset)
     }
 }