diff options
| author | Benoît du Garreau <benoit@dugarreau.fr> | 2025-07-09 18:11:26 +0200 |
|---|---|---|
| committer | Benoît du Garreau <benoit@dugarreau.fr> | 2025-07-09 18:11:26 +0200 |
| commit | 803b4d262241b22a4dfe75fcec49eaf920e0816b (patch) | |
| tree | f7a993502d363fc242fd357735cdcf7b949c7622 /library/core/src | |
| parent | 6b3ae3f6e45a33c2d95fa0362c9b2593e567fd34 (diff) | |
| download | rust-803b4d262241b22a4dfe75fcec49eaf920e0816b.tar.gz rust-803b4d262241b22a4dfe75fcec49eaf920e0816b.zip | |
core: Remove `BorrowedCursor::init_ref` method
This method was not really useful: at no point one would only need to read the initialized part of the cursor without mutating it.
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/io/borrowed_buf.rs | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/library/core/src/io/borrowed_buf.rs b/library/core/src/io/borrowed_buf.rs index 854e03cf182..11ace041998 100644 --- a/library/core/src/io/borrowed_buf.rs +++ b/library/core/src/io/borrowed_buf.rs @@ -227,16 +227,6 @@ impl<'a> BorrowedCursor<'a> { self.buf.filled - self.start } - /// Returns a shared reference to the initialized portion of the cursor. - #[inline] - pub fn init_ref(&self) -> &[u8] { - // SAFETY: We only slice the initialized part of the buffer, which is always valid - unsafe { - let buf = self.buf.buf.get_unchecked(self.buf.filled..self.buf.init); - buf.assume_init_ref() - } - } - /// Returns a mutable reference to the initialized portion of the cursor. #[inline] pub fn init_mut(&mut self) -> &mut [u8] { |
