Skip to content

Commit

Permalink
Convert range test to guard
Browse files Browse the repository at this point in the history
  • Loading branch information
tuffy committed Aug 20, 2024
1 parent 45a11e4 commit f6298b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bitstream-io"
description = "Library for reading/writing un-aligned values from/to streams in big-endian and little-endian formats."
keywords = ["bitstream", "endian", "big-endian", "little-endian", "binary"]
version = "2.5.1"
version = "2.5.2"
authors = ["Brian Langenberger <[email protected]>"]
license = "MIT/Apache-2.0"
documentation = "https://docs.rs/bitstream-io/"
Expand Down
2 changes: 1 addition & 1 deletion src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ pub trait BitRead {

match bytes {
0 => Ok(Vec::new()),
1..MAX_CHUNK => {
bytes if bytes <= MAX_CHUNK => {
let mut buf = vec![0; bytes];
self.read_bytes(&mut buf)?;
Ok(buf)
Expand Down

0 comments on commit f6298b5

Please sign in to comment.