From 8e28283dadc6e79e4bd33130ddb8d90e6ba20647 Mon Sep 17 00:00:00 2001 From: Skywalkingzulu1 Date: Thu, 15 Oct 2026 17:29:51 +0200 Subject: [PATCH] =?UTF-8?q?build(deps):=20upgrade=20zip=203=20=E2=86=92=20?= =?UTF-8?q?9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump the zip crate from 3 to 9 in the workspace Cargo.toml and adapt to the API change in 2.0+: last_modified_time now takes Option instead of DateTime directly. - crates/io/src/lib.rs: wrap DateTime::default() in Some(...) - crates/geometry/src/tagged_mesh.rs: same fix in the 3MF writer Closes #134 --- Cargo.toml | 4 ++-- crates/geometry/src/tagged_mesh.rs | 2 +- crates/io/src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e00ba93..adf0f67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,8 +35,8 @@ serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["float_roundtrip"] } log = "0.4" -# 3MF packages (docs/formats/tagged-mesh.md). -zip = { version = "3", default-features = false, features = ["deflate"] } +# 3MF packages (docs/formats/tagged-mesh.md). zip is ahead of SolidCraft (still on 3), so both are built. +zip = { version = "9", default-features = false, features = ["deflate"] } quick-xml = "0.42" # content hashes and part checksums of .fieldcraft files (the version SolidCraft uses) diff --git a/crates/geometry/src/tagged_mesh.rs b/crates/geometry/src/tagged_mesh.rs index 98a4f5a..20e1b89 100644 --- a/crates/geometry/src/tagged_mesh.rs +++ b/crates/geometry/src/tagged_mesh.rs @@ -446,7 +446,7 @@ mod tests { for (name, data) in [("[Content_Types].xml", types), ("_rels/.rels", rels), ("3D/3dmodel.model", x.as_str())] { let o = zip::write::SimpleFileOptions::default() .compression_method(zip::CompressionMethod::Deflated) - .last_modified_time(zip::DateTime::default()); + .last_modified_time(Some(zip::DateTime::default())); zip.start_file(name, o).unwrap(); zip.write_all(data.as_bytes()).unwrap(); } diff --git a/crates/io/src/lib.rs b/crates/io/src/lib.rs index fdee8c7..044bb94 100644 --- a/crates/io/src/lib.rs +++ b/crates/io/src/lib.rs @@ -335,7 +335,7 @@ pub fn write(model: &Model, geometry: &Geometry, journal: &[JournalEntry], view: // Fixed time and permissions: the bytes depend on the model only. let options = zip::write::SimpleFileOptions::default() .compression_method(zip::CompressionMethod::Stored) - .last_modified_time(zip::DateTime::default()) + .last_modified_time(Some(zip::DateTime::default())) .unix_permissions(0o644) .large_file(bytes.len() as u64 >= u64::from(u32::MAX)); zip.start_file(name, options).map_err(zip_error)?;