From 8d446779fd120539b85fa334f05bd051874ef549 Mon Sep 17 00:00:00 2001 From: Ethan Date: Sat, 17 Aug 2024 21:30:30 +0900 Subject: [PATCH] no string --- lib/src/lib.rs | 4 ---- lib/src/vpk0.rs | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 2ba6bfb..f9e8200 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -38,10 +38,6 @@ pub enum Crunch64Error { NullPointer, #[error("Invalid compression level")] InvalidCompressionLevel, - #[cfg(not(feature = "c_bindings"))] - #[error("Failed to handle vpk0 data: {0}")] - Vpk0(String), - #[cfg(feature = "c_bindings")] #[error("Failed to handle vpk0 data")] Vpk0, } diff --git a/lib/src/vpk0.rs b/lib/src/vpk0.rs index e051768..db2f3ae 100644 --- a/lib/src/vpk0.rs +++ b/lib/src/vpk0.rs @@ -3,13 +3,13 @@ use crate::Crunch64Error; pub fn compress(bytes: &[u8]) -> Result, Crunch64Error> { match vpk0::encode_bytes(bytes) { Ok(bytes) => Ok(bytes.into_boxed_slice()), - Err(e) => Err(Crunch64Error::Vpk0(e.to_string())), + Err(_) => Err(Crunch64Error::Vpk0), } } pub fn decompress(bytes: &[u8]) -> Result, Crunch64Error> { match vpk0::decode_bytes(bytes) { Ok(bytes) => Ok(bytes.into_boxed_slice()), - Err(e) => Err(Crunch64Error::Vpk0(e.to_string())), + Err(_) => Err(Crunch64Error::Vpk0), } }