Add impl<R: Read> Read for &mut R to std_shims

Increases parity with `std::io`.
This commit is contained in:
Luke Parker
2025-09-12 18:25:10 -04:00
parent c83fbb3e44
commit dd7dc0c1dc
3 changed files with 8 additions and 2 deletions

View File

@@ -64,6 +64,12 @@ mod shims {
}
}
impl<R: Read> Read for &mut R {
fn read(&mut self, buf: &mut [u8]) -> Result<usize> {
R::read(*self, buf)
}
}
pub trait BufRead: Read {
fn fill_buf(&mut self) -> Result<&[u8]>;
fn consume(&mut self, amt: usize);