Update lz4_flex version

This commit is contained in:
Noah committed 2020-12-19 14:59:06 -06:00
1 parent 57805f791f
commit a7363110ae
3 files changed
+3 -9

No files matched your search

Generated
+2 -2
View File
@@ -1110,9 +1110,9 @@ dependencies = [
[[package]]
name = "lz4_flex"
version = "0.4.1"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e7bea5a3a7bb3c040adc89eadadee33c3d39371b20dd980c952dd2642867b99"
checksum = "50e76831e3b044ebf7008b17d6083e4dda6d8a9f6839387d7a81fad549417f57"
dependencies = [
"byteorder",
"quick-error",
+1 -1
View File
@@ -11,7 +11,7 @@ license = "MIT"
[dependencies]
bincode = "1.1"
bitflags = "1.1"
lz4_flex = "0.4"
lz4_flex = "0.5"
num-bigint = { version = "0.3", features = ["serde"] }
num-complex = { version = "0.3", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
-6
View File
@@ -732,12 +732,6 @@ impl<C: Constant> CodeObject<C> {
impl CodeObject<ConstantData> {
/// Load a code object from bytes
pub fn from_bytes(data: &[u8]) -> Result<Self, Box<dyn std::error::Error>> {
// TODO: PR to lz4_flex to make it not panic
if data.len() < 4 {
return Err(
std::io::Error::new(std::io::ErrorKind::UnexpectedEof, "bad bytecode").into(),
);
}
let raw_bincode = lz4_flex::decompress_size_prepended(data)?;
let data = bincode::deserialize(&raw_bincode)?;
Ok(data)