diff options
| author | Benoît du Garreau <bdgdlm@outlook.com> | 2024-03-12 18:08:29 +0100 |
|---|---|---|
| committer | Benoît du Garreau <bdgdlm@outlook.com> | 2024-03-12 18:28:55 +0100 |
| commit | 87348093954be36b2583dda2e6e842950d346254 (patch) | |
| tree | 31e17e7696321a9881e892fd58dcbaa2898020a7 /library/std/src/io/stdio.rs | |
| parent | 7de1a1f6db26cf7af43cca74819118428e6317ee (diff) | |
| download | rust-87348093954be36b2583dda2e6e842950d346254.tar.gz rust-87348093954be36b2583dda2e6e842950d346254.zip | |
Specialize many implementations of `Read::read_buf_exact`
Diffstat (limited to 'library/std/src/io/stdio.rs')
| -rw-r--r-- | library/std/src/io/stdio.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index ccc2ed91688..89fe531e8f2 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -451,6 +451,9 @@ impl Read for Stdin { fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> { self.lock().read_exact(buf) } + fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> { + self.lock().read_buf_exact(cursor) + } } #[stable(feature = "read_shared_stdin", since = "CURRENT_RUSTC_VERSION")] @@ -477,6 +480,9 @@ impl Read for &Stdin { fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> { self.lock().read_exact(buf) } + fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> { + self.lock().read_buf_exact(cursor) + } } // only used by platform-dependent io::copy specializations, i.e. unused on some platforms @@ -517,6 +523,10 @@ impl Read for StdinLock<'_> { fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> { self.inner.read_exact(buf) } + + fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> io::Result<()> { + self.inner.read_buf_exact(cursor) + } } impl SpecReadByte for StdinLock<'_> { |
