Skip to content

Commit 1e63f08

Browse files
committed
Take shared references as parameter
1 parent 2fc23c2 commit 1e63f08

File tree

1 file changed

+4
-12
lines changed
  • library/std/src/os/unix

1 file changed

+4
-12
lines changed

library/std/src/os/unix/fs.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ pub trait FileExt {
6060
/// written to possibly being only partially filled. This method must behave
6161
/// equivalently to a single call to read with concatenated buffers.
6262
#[unstable(feature = "unix_file_vectored_at", issue = "89517")]
63-
fn read_vectored_at(
64-
&mut self,
65-
bufs: &mut [io::IoSliceMut<'_>],
66-
offset: u64,
67-
) -> io::Result<usize> {
63+
fn read_vectored_at(&self, bufs: &mut [io::IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
6864
io::default_read_vectored(|b| self.read_at(b, offset), bufs)
6965
}
7066

@@ -175,7 +171,7 @@ pub trait FileExt {
175171
/// from possibly being only partially consumed. This method must behave as
176172
/// a call to `write_at` with the buffers concatenated would.
177173
#[unstable(feature = "unix_file_vectored_at", issue = "89517")]
178-
fn write_vectored_at(&mut self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
174+
fn write_vectored_at(&self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
179175
io::default_write_vectored(|b| self.write_at(b, offset), bufs)
180176
}
181177

@@ -242,17 +238,13 @@ impl FileExt for fs::File {
242238
fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
243239
self.as_inner().read_at(buf, offset)
244240
}
245-
fn read_vectored_at(
246-
&mut self,
247-
bufs: &mut [io::IoSliceMut<'_>],
248-
offset: u64,
249-
) -> io::Result<usize> {
241+
fn read_vectored_at(&self, bufs: &mut [io::IoSliceMut<'_>], offset: u64) -> io::Result<usize> {
250242
self.as_inner().read_vectored_at(bufs, offset)
251243
}
252244
fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
253245
self.as_inner().write_at(buf, offset)
254246
}
255-
fn write_vectored_at(&mut self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
247+
fn write_vectored_at(&self, bufs: &[io::IoSlice<'_>], offset: u64) -> io::Result<usize> {
256248
self.as_inner().write_vectored_at(bufs, offset)
257249
}
258250
}

0 commit comments

Comments
 (0)