From c888b61b97b9d21fa54508c36f03fefc2bb858d8 Mon Sep 17 00:00:00 2001 From: "bootc-bot[bot]" <225049296+bootc-bot[bot]@users.noreply.github.com> Date: Sun, 29 Mar 2026 00:53:05 +0000 Subject: [PATCH 1/2] chore(deps): update rust Signed-off-by: bootc-bot[bot] <225049296+bootc-bot[bot]@users.noreply.github.com> --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 93968b4..a3b0906 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,8 @@ thiserror = "2.0.12" [dev-dependencies] proptest = "1.7.0" similar-asserts = "1.7.0" -cap-std = "3.4.4" -sha2 = "0.10.9" +cap-std = "4.0.0" +sha2 = "0.11.0" # For cross-integration testing olpc-cjson = "0.1" cjson = "0.1.2" From abe0fce89686b1937c7d288f73ec7d1d6c6aa5ea Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Tue, 31 Mar 2026 11:21:56 +0800 Subject: [PATCH 2/2] tests: Fix sha256 digest hex formatting for sha2 0.11 compat The sha2 0.11 crate no longer implements LowerHex on the digest output type. Format the hash by iterating over bytes instead, which works with both 0.10 and 0.11. Assisted-by: Claude Code (Opus 4.6) Co-Authored-By: Claude Opus 4.6 Signed-off-by: Xiaofeng Wang --- src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0f2458f..087aa52 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -679,7 +679,12 @@ mod tests { // testdata sha256sum are computed with a trailing \n sha256.update("\n"); let filename = filename.trim_end_matches(".json"); - let hash = format!("{:x}", sha256.finalize()); + let digest = sha256.finalize(); + let hash = digest.iter().fold(String::new(), |mut s, b| { + use std::fmt::Write; + write!(s, "{b:02x}").unwrap(); + s + }); assert_eq!(filename, hash); let json2: serde_json::Value = serde_json::from_slice(&enc)?;