From b51b8f24d27da3c9971a1fdfbc9e883421a26a80 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Mon, 20 Jul 2026 12:26:13 +0200 Subject: [PATCH] fix(compress): remove dead parameter aliases The parameter policy leaves now export their C API names directly from Rust. Two compatibility aliases were only used by the Rust unit test, while the library and clippy builds correctly treated them as unused. Remove those dead aliases and call the direct Rust-owned clamp symbol from the test so the library, bench, and test targets share the same ABI surface without warning under `-D warnings`. Test Plan: - Capped `cargo clippy --manifest-path rust/Cargo.toml -- -D warnings` -- passed. - Capped `cargo clippy --manifest-path rust/Cargo.toml --benches -- -D warnings` -- passed. - Capped `cargo clippy --manifest-path rust/Cargo.toml --tests -- -D warnings` -- passed. - `cargo +nightly fmt --manifest-path rust/Cargo.toml --all -- --check` -- passed. - `git diff --cached --check` -- passed. --- rust/src/zstd_compress_params.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/src/zstd_compress_params.rs b/rust/src/zstd_compress_params.rs index b13922f70..575465b70 100644 --- a/rust/src/zstd_compress_params.rs +++ b/rust/src/zstd_compress_params.rs @@ -1181,8 +1181,6 @@ pub extern "C" fn ZSTD_cycleLog(hashLog: u32, strategy: c_int) -> u32 { /* Keep existing Rust parameter-module callers source-compatible while the * C symbols are owned directly by these Rust leaves. */ pub(crate) use ZSTD_checkCParams as ZSTD_rust_params_checkCParams; -pub(crate) use ZSTD_clampCParams as ZSTD_rust_params_clampCParams; -pub(crate) use ZSTD_cycleLog as ZSTD_rust_params_cycleLog; /// C ABI for private `ZSTD_getCParamRowSize()`. #[no_mangle] @@ -2689,7 +2687,7 @@ mod tests { assert_eq!(adjusted.chainLog, 7); assert_eq!(ZSTD_rust_params_checkCParams(adjusted), 0); - let clamped = ZSTD_rust_params_clampCParams(ZSTD_compressionParameters { + let clamped = ZSTD_clampCParams(ZSTD_compressionParameters { windowLog: u32::MAX, chainLog: 0, hashLog: 0,