Skip to content

Commit 6d101c2

Browse files
committed
Provide exact reads for StdinRaw
1 parent ef35b78 commit 6d101c2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/std/src/io/stdio.rs

+8
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ impl Read for StdinRaw {
120120
fn read_to_string(&mut self, buf: &mut String) -> io::Result<usize> {
121121
handle_ebadf(self.0.read_to_string(buf), 0)
122122
}
123+
124+
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
125+
handle_ebadf(self.0.read_exact(buf), ())
126+
}
127+
128+
fn read_buf_exact(&mut self, buf: BorrowedCursor<'_>) -> io::Result<()> {
129+
handle_ebadf(self.0.read_buf_exact(buf), ())
130+
}
123131
}
124132

125133
impl Write for StdoutRaw {

0 commit comments

Comments
 (0)