From 5cfbb3f393b3dfebf6cac1fb0f8ae3d804e3ae19 Mon Sep 17 00:00:00 2001 From: icefire <6960694+jackalstomper@users.noreply.github.com> Date: Mon, 13 Oct 2025 17:24:24 -0300 Subject: [PATCH] Update dependencies Updates lzokay to latest commit Updates cc and bindgen to latest versions --- Cargo.toml | 6 +++--- build.rs | 2 +- lzokay | 2 +- src/compress.rs | 14 ++++++++++---- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 37348bd..a64e479 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lzokay" -version = "1.0.1" +version = "1.0.2" edition = "2018" license = "MIT" repository = "https://github.com/encounter/lzokay-rs" @@ -20,5 +20,5 @@ compress = [] default = ["compress", "decompress", "std"] [build-dependencies] -bindgen = "0.59.1" -cc = "1.0.69" +bindgen = "0.72.1" +cc = "1.2.41" diff --git a/build.rs b/build.rs index a3f9925..e17ac2b 100644 --- a/build.rs +++ b/build.rs @@ -19,7 +19,7 @@ fn main() { .ctypes_prefix("types") .derive_debug(false) .clang_arg("-std=c++14") - .parse_callbacks(Box::new(bindgen::CargoCallbacks)); + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())); #[cfg(not(feature = "std"))] { bindings = bindings.layout_tests(false); diff --git a/lzokay b/lzokay index 546a969..db2df1f 160000 --- a/lzokay +++ b/lzokay @@ -1 +1 @@ -Subproject commit 546a9695271e8a8b4711383f828172754fd825f2 +Subproject commit db2df1fcbebc2ed06c10f727f72567d40f06a2be diff --git a/src/compress.rs b/src/compress.rs index 656e6cb..9db187d 100644 --- a/src/compress.rs +++ b/src/compress.rs @@ -84,13 +84,15 @@ pub fn new_dict() -> Dict<'static> { } /// Dictionary storage size, for manual or stack allocation. -pub const fn dict_storage_size() -> usize { size_of::() } +pub const fn dict_storage_size() -> usize { + size_of::() +} /// Creates a dictionary from the supplied storage. /// /// Storage **must** be at least [`dict_storage_size()`] bytes, /// otherwise this function will panic. -pub fn dict_from_storage(storage: &mut [u8]) -> Dict { +pub fn dict_from_storage(storage: &mut [u8]) -> Dict<'_> { if storage.len() < dict_storage_size() { panic!( "Dictionary storage is not large enough: {}, expected {}", @@ -107,13 +109,17 @@ pub fn dict_from_storage(storage: &mut [u8]) -> Dict { } /// Worst-case compression size. -pub const fn compress_worst_size(s: usize) -> usize { s + s / 16 + 64 + 3 } +pub const fn compress_worst_size(s: usize) -> usize { + s + s / 16 + 64 + 3 +} /// Compress the supplied buffer into a heap-allocated vector. /// /// Creates a new dictionary for each invocation. #[cfg(feature = "alloc")] -pub fn compress(src: &[u8]) -> Result, Error> { compress_with_dict(src, &mut new_dict()) } +pub fn compress(src: &[u8]) -> Result, Error> { + compress_with_dict(src, &mut new_dict()) +} /// Compress the supplied buffer into a heap-allocated vector, /// with the supplied pre-allocated dictionary.