1
0
Fork 0
mirror of https://codeberg.org/icewind/bitbuffer.git synced 2026-06-03 16:44:06 +02:00

fix skip_bits check when skipping to the end of the stream

This commit is contained in:
Robin Appelman 2020-01-19 22:32:51 +01:00
commit aa42c955ce

View file

@ -405,7 +405,7 @@ where
/// ///
/// [`ReadError::NotEnoughData`]: enum.ReadError.html#variant.NotEnoughData /// [`ReadError::NotEnoughData`]: enum.ReadError.html#variant.NotEnoughData
pub fn skip_bits(&mut self, count: usize) -> Result<()> { pub fn skip_bits(&mut self, count: usize) -> Result<()> {
if count < self.bits_left() { if count <= self.bits_left() {
self.pos += count; self.pos += count;
Ok(()) Ok(())
} else { } else {