Skip to content

Commit

Permalink
no string
Browse files Browse the repository at this point in the history
  • Loading branch information
ethteck committed Aug 17, 2024
1 parent 89102ae commit 8d44677
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions lib/src/vpk0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use crate::Crunch64Error;
pub fn compress(bytes: &[u8]) -> Result<Box<[u8]>, 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<Box<[u8]>, 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),
}
}

0 comments on commit 8d44677

Please sign in to comment.