1 2 3 4 5 6 7 8 9 10 11 12 13 14
use std::io; pub(crate) trait ReadByte { fn read_byte(&mut self) -> io::Result<u8>; } impl<R: io::Read> ReadByte for R { #[inline] fn read_byte(&mut self) -> io::Result<u8> { let mut buf = [0u8]; self.read_exact(&mut buf)?; Ok(buf[0]) } }