about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-07-17 03:58:32 +0200
committerGitHub <noreply@github.com>2025-07-17 03:58:32 +0200
commitb9fd2bccfad4fd56538ccc4ae20b62c72748c311 (patch)
treee8a4d42e706fad8cb6d7088106c8f409334cb025 /library/std
parentac98b4e733d498ce7452ea8d2a2b7f8010cb5e40 (diff)
parent65df66831f3fdb7f20a74e843a46bb90993221eb (diff)
Rollup merge of #143829 - a1phyr:trim_borrowed_buf, r=ChrisDenton
Trim `BorrowedCursor` API

This PR removes some method from the unstable `BorrowedCursor` type. A rational for each change can be found in the message of each commit.

I don't think that an ACP is required for this, please tell me if it is not the case.

Cc rust-lang/rust#78485 rust-lang/rust#117693
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/io/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs
index 17c32d7a571..d351ee5e739 100644
--- a/library/std/src/io/mod.rs
+++ b/library/std/src/io/mod.rs
@@ -489,7 +489,7 @@ pub(crate) fn default_read_to_end<R: Read + ?Sized>(
             }
         };
 
-        let unfilled_but_initialized = cursor.init_ref().len();
+        let unfilled_but_initialized = cursor.init_mut().len();
         let bytes_read = cursor.written();
         let was_fully_initialized = read_buf.init_len() == buf_len;
 
@@ -3053,7 +3053,7 @@ impl<T: Read> Read for Take<T> {
             // The condition above guarantees that `self.limit` fits in `usize`.
             let limit = self.limit as usize;
 
-            let extra_init = cmp::min(limit, buf.init_ref().len());
+            let extra_init = cmp::min(limit, buf.init_mut().len());
 
             // SAFETY: no uninit data is written to ibuf
             let ibuf = unsafe { &mut buf.as_mut()[..limit] };
@@ -3068,7 +3068,7 @@ impl<T: Read> Read for Take<T> {
             let mut cursor = sliced_buf.unfilled();
             let result = self.inner.read_buf(cursor.reborrow());
 
-            let new_init = cursor.init_ref().len();
+            let new_init = cursor.init_mut().len();
             let filled = sliced_buf.len();
 
             // cursor / sliced_buf / ibuf must drop here