BurntSushi / byteorder

Rust library for reading/writing numbers in big-endian and little-endian.
The Unlicense
984 stars 144 forks source link

panic in try from slice #173

Closed robjtede closed 3 years ago

robjtede commented 3 years ago

Looks like something panics that didn't before 1.4.0.

thread 'actix-rt:worker:0' panicked at 'called `Result::unwrap()` on an `Err` value: TryFromSliceError(())', /home/jens/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.4.0/src/lib.rs:2185:43

Related to: https://github.com/actix/actix-web/issues/1890

for those finding this, workaround in Cargo.toml, add:

byteorder = "~1.3"
robjtede commented 3 years ago

Most basic test case that works in 1.3 and fails in 1.4:

byteorder::BigEndian::read_u16(&[1, 2, 3]);
pimeys commented 3 years ago

Yeah. We also have now our build pipelines red because some of the deps is going with version = "1", got upgraded to 1.4.0 and fails hard now...

BurntSushi commented 3 years ago

This has been fixed in byteorder 1.4.1.

@pimeys If you want reproducible builds and avoid having your pipelines fail because of changes in the environment, then you need to use Cargo.lock at minimum.

pimeys commented 3 years ago

We do in the binaries, but this was one library that didn't have one. And I just happened to build when this upgrade arrived!