mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-03 08:34:07 +02:00
less panicy read_bool
This commit is contained in:
parent
34411a7c80
commit
5b89a5940d
2 changed files with 3 additions and 3 deletions
|
|
@ -8,5 +8,5 @@ matrix:
|
|||
- rust: nightly
|
||||
fast_finish: true
|
||||
script:
|
||||
- cargo build --verbose --all
|
||||
- cargo test --verbose --all
|
||||
- cargo test --all
|
||||
- cargo test --all --all-features
|
||||
|
|
@ -174,7 +174,7 @@ where
|
|||
.get(byte_index)
|
||||
.ok_or_else(|| ReadError::NotEnoughData {
|
||||
requested: 1,
|
||||
bits_left: self.bit_len() - position,
|
||||
bits_left: self.bit_len().saturating_sub(position),
|
||||
})
|
||||
.map(|byte| {
|
||||
let shifted = byte >> bit_offset;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue