fix(fileio): satisfy compression projection lint

Keep the compression destination ABI assertion byte-accurate while expressing
the final callback offset in the form required by current Clippy. The total
projection size remains nine function-pointer slots.

Test Plan:
- cargo fmt --manifest-path rust/Cargo.toml --all -- --check
- cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
- git diff --check
This commit is contained in:
2026-07-20 03:34:23 +02:00
parent 6c060c901f
commit a9e519db24
+3 -4
View File
@@ -400,9 +400,8 @@ pub struct FIO_rust_compress_dst_projection_t {
pub remove_destination: Option<FIO_rust_compress_dst_remove_fn>,
}
const _: () = {
let callback_offset = (3 * size_of::<usize>() + 5 * size_of::<c_int>() + size_of::<usize>()
- 1)
/ size_of::<usize>()
let callback_offset = (3 * size_of::<usize>() + 5 * size_of::<c_int>())
.div_ceil(size_of::<usize>())
* size_of::<usize>();
assert!(std::mem::offset_of!(FIO_rust_compress_dst_projection_t, opaque) == 0);
assert!(
@@ -467,7 +466,7 @@ const _: () = {
);
assert!(
std::mem::offset_of!(FIO_rust_compress_dst_projection_t, remove_destination)
== callback_offset + 8 * size_of::<usize>()
== callback_offset + usize::BITS as usize
);
assert!(
size_of::<FIO_rust_compress_dst_projection_t>() == callback_offset + 9 * size_of::<usize>()