diff --git a/Cargo.toml b/Cargo.toml index 6daa64b..9da0802 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,7 @@ clap = { version = "4.5.47", features = ["derive"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" -bincode = { version = "2.0.1", features = ["serde"] } -bincode1 = { package = "bincode", version = "1.3", optional = false } +rawbin = "1.0" sha2 = "0.10" hex = "0.4" camino = "1.1" diff --git a/example/github/pacm.lockb b/example/github/pacm.lockb index 1ce36f2..3d86cd5 100644 Binary files a/example/github/pacm.lockb and b/example/github/pacm.lockb differ diff --git a/example/pacm/pacm.lockb b/example/pacm/pacm.lockb index 2d1feda..4411f7b 100644 Binary files a/example/pacm/pacm.lockb and b/example/pacm/pacm.lockb differ diff --git a/example/workspaces/pacm.lockb b/example/workspaces/pacm.lockb index 5b0c245..b740a72 100644 Binary files a/example/workspaces/pacm.lockb and b/example/workspaces/pacm.lockb differ diff --git a/src/lockfile.rs b/src/lockfile.rs index 1b069a9..19870d5 100644 --- a/src/lockfile.rs +++ b/src/lockfile.rs @@ -1,9 +1,9 @@ use crate::error::Result; use crate::manifest::Manifest; use anyhow::{anyhow, bail, ensure, Context}; -use bincode::config::{legacy, standard}; -use bincode::serde::decode_from_slice; -use bincode1::Options; +use rawbin::config::{legacy, standard}; +use rawbin::serde::decode_from_slice; +use rawbin::Options; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use std::{collections::BTreeMap, fs, path::PathBuf}; @@ -412,7 +412,7 @@ where T: DeserializeOwned, { let cfg = standard().with_limit::(); - std::panic::catch_unwind(|| decode_from_slice::(data, cfg)) + std::panic::catch_unwind(|| decode_from_slice::(data, cfg)) .ok() .and_then(|res| res.ok().map(|(value, _)| value)) } @@ -422,7 +422,7 @@ where T: DeserializeOwned, { let cfg = legacy().with_limit::(); - std::panic::catch_unwind(|| decode_from_slice::(data, cfg)) + std::panic::catch_unwind(|| decode_from_slice::(data, cfg)) .ok() .and_then(|res| res.ok().map(|(value, _)| value)) } @@ -432,7 +432,7 @@ where T: DeserializeOwned, { std::panic::catch_unwind(|| { - bincode1::config::DefaultOptions::new() + Options::new() .with_limit(MAX_LOCKFILE_SIZE as u64) .allow_trailing_bytes() .deserialize::(data) @@ -446,7 +446,7 @@ where T: DeserializeOwned, { std::panic::catch_unwind(|| { - bincode1::config::DefaultOptions::new() + Options::new() .with_fixint_encoding() .with_limit(MAX_LOCKFILE_SIZE as u64) .allow_trailing_bytes()