mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Remove MemDecoder::read_byte
.
It's just a synonym for `read_u8`.
This commit is contained in:
parent
7a16d25365
commit
a676dfa888
@ -504,19 +504,6 @@ impl<'a> MemDecoder<'a> {
|
||||
panic!("MemDecoder exhausted")
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn read_byte(&mut self) -> u8 {
|
||||
if self.current == self.end {
|
||||
Self::decoder_exhausted();
|
||||
}
|
||||
// SAFETY: This type guarantees current <= end, and we just checked current == end.
|
||||
unsafe {
|
||||
let byte = *self.current;
|
||||
self.current = self.current.add(1);
|
||||
byte
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn read_array<const N: usize>(&mut self) -> [u8; N] {
|
||||
self.read_raw_bytes(N).try_into().unwrap()
|
||||
@ -586,7 +573,15 @@ impl<'a> Decoder for MemDecoder<'a> {
|
||||
|
||||
#[inline]
|
||||
fn read_u8(&mut self) -> u8 {
|
||||
self.read_byte()
|
||||
if self.current == self.end {
|
||||
Self::decoder_exhausted();
|
||||
}
|
||||
// SAFETY: This type guarantees current <= end, and we just checked current == end.
|
||||
unsafe {
|
||||
let byte = *self.current;
|
||||
self.current = self.current.add(1);
|
||||
byte
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user