diff --git a/library/std/src/sys/pal/osstd/fs.rs b/library/std/src/sys/pal/osstd/fs.rs index 474c9fe97d1..9585ec24f68 100644 --- a/library/std/src/sys/pal/osstd/fs.rs +++ b/library/std/src/sys/pal/osstd/fs.rs @@ -198,6 +198,26 @@ impl File { self.0 } + pub fn lock(&self) -> io::Result<()> { + self.0 + } + + pub fn lock_shared(&self) -> io::Result<()> { + self.0 + } + + pub fn try_lock(&self) -> io::Result { + self.0 + } + + pub fn try_lock_shared(&self) -> io::Result { + self.0 + } + + pub fn unlock(&self) -> io::Result<()> { + self.0 + } + pub fn truncate(&self, _size: u64) -> io::Result<()> { self.0 } diff --git a/library/std/src/sys/pal/osstd/io.rs b/library/std/src/sys/pal/osstd/io.rs index 6372fca74e0..604735d32d5 100644 --- a/library/std/src/sys/pal/osstd/io.rs +++ b/library/std/src/sys/pal/osstd/io.rs @@ -15,7 +15,7 @@ impl<'a> IoSlice<'a> { } #[inline] - pub fn as_slice(&self) -> &[u8] { + pub const fn as_slice(&self) -> &'a [u8] { self.0 } } @@ -40,6 +40,11 @@ impl<'a> IoSliceMut<'a> { self.0 } + #[inline] + pub const fn into_slice(self) -> &'a mut [u8] { + self.0 + } + #[inline] pub fn as_mut_slice(&mut self) -> &mut [u8] { self.0