Skip to content

Commit 964daec

Browse files
authored
chore: switch test from bincode to maintained postcard crate (RUSTSEC-2025-0141 ) (#9104)
# Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. --> - Closes #9009 - Also addresses https://rustsec.org/advisories/RUSTSEC-2025-0141 -- this is only used for testing but still # Rationale for this change https://crates.io/crates/bincode is unmaintained <img width="833" height="657" alt="Screenshot 2026-01-06 at 5 57 13 PM" src="https://github.com/user-attachments/assets/9e18a6e5-eb45-4470-94b7-e17b89ad558e" /> There also appears to be some sort of drama related to the maintainer While we only use this code in tests, it would be nice to avoid issues sooner rather than later # What changes are included in this PR? Change to use postcard # Are these changes tested? by ci # Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please call them out. -->
1 parent 73bbfee commit 964daec

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

arrow-schema/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,9 @@ serde = ["dep:serde_core", "dep:serde"]
5353
all-features = true
5454

5555
[dev-dependencies]
56-
bincode = { version = "2.0.1", default-features = false, features = [
57-
"std",
58-
"serde",
59-
] }
6056
criterion = { workspace = true, default-features = false }
6157
insta = "1.43.1"
58+
postcard = { version = "1.0.10", default-features = false, features = ["use-std"] }
6259

6360
[[bench]]
6461
name = "ffi"

arrow-schema/src/field.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,10 +1448,8 @@ mod test {
14481448

14491449
#[cfg(feature = "serde")]
14501450
fn assert_binary_serde_round_trip(field: Field) {
1451-
let config = bincode::config::legacy();
1452-
let serialized = bincode::serde::encode_to_vec(&field, config).unwrap();
1453-
let (deserialized, _): (Field, _) =
1454-
bincode::serde::decode_from_slice(&serialized, config).unwrap();
1451+
let serialized = postcard::to_stdvec(&field).unwrap();
1452+
let deserialized: Field = postcard::from_bytes(&serialized).unwrap();
14551453
assert_eq!(field, deserialized)
14561454
}
14571455

0 commit comments

Comments
 (0)