From 389aef0fdafd0fdc961a119ddb1f7095b5b3e485 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 22:27:35 +0000 Subject: [PATCH] Use neutral errors in shared XFL reader --- crates/xfl/src/lib.rs | 4 ++-- crates/xfl/src/tests.rs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/xfl/src/lib.rs b/crates/xfl/src/lib.rs index f6e04b2d9..5629a0e0f 100644 --- a/crates/xfl/src/lib.rs +++ b/crates/xfl/src/lib.rs @@ -39,9 +39,9 @@ pub enum ZipError { Damaged(&'static str), #[error("the archive is damaged: '{0}' {1}")] DamagedEntry(String, &'static str), - #[error("the archive uses a zip feature AniCraft can't read ({0})")] + #[error("the archive uses a zip feature this XFL reader can't read ({0})")] UnsupportedArchive(&'static str), - #[error("'{0}' uses a zip feature AniCraft can't read ({1})")] + #[error("'{0}' uses a zip feature this XFL reader can't read ({1})")] Unsupported(String, &'static str), #[error("'{0}' is too large to read")] TooLarge(String), diff --git a/crates/xfl/src/tests.rs b/crates/xfl/src/tests.rs index a3845f6ec..e6aba944b 100644 --- a/crates/xfl/src/tests.rs +++ b/crates/xfl/src/tests.rs @@ -232,6 +232,11 @@ fn deeply_nested_folders_are_refused() { #[test] fn unsupported_features_say_what_they_are() { + assert_eq!(ZipError::UnsupportedArchive("split across several files").to_string(), "the archive uses a zip feature this XFL reader can't read (split across several files)"); + assert_eq!( + ZipError::Unsupported("a.xml".into(), "encryption").to_string(), + "'a.xml' uses a zip feature this XFL reader can't read (encryption)" + ); let mut r = Raw::new("a.xml", b"secret", false); r.flags = 1; assert_eq!(error(&write(&[r], false)), ZipError::Unsupported("a.xml".into(), "encryption"));