style(rust): format newly migrated policy bridges

Apply rustfmt to the stream-result and MT input-range policy projections and their focused tests. This is mechanical only; it keeps the new Rust seams compliant with the repository formatter without changing behavior.

Test Plan: ulimit -v 41943040; CARGO_BUILD_JOBS=1 cargo +nightly fmt --manifest-path rust/Cargo.toml --all -- --check; git diff --cached --check.
This commit is contained in:
2026-07-21 07:17:16 +02:00
parent 3215458381
commit 484a76757b
2 changed files with 11 additions and 33 deletions
+5 -14
View File
@@ -278,9 +278,7 @@ pub struct ZSTD_rust_compressStream2ResultPolicyState {
const _: () = {
assert!(size_of::<Option<CompressStream2SetBufferExpectationsFn>>() == size_of::<usize>());
assert!(
offset_of!(ZSTD_rust_compressStream2ResultPolicyState, callback_context) == 0
);
assert!(offset_of!(ZSTD_rust_compressStream2ResultPolicyState, callback_context) == 0);
assert!(
offset_of!(
ZSTD_rust_compressStream2ResultPolicyState,
@@ -288,12 +286,10 @@ const _: () = {
) == size_of::<usize>()
);
assert!(
offset_of!(ZSTD_rust_compressStream2ResultPolicyState, output)
== 2 * size_of::<usize>()
offset_of!(ZSTD_rust_compressStream2ResultPolicyState, output) == 2 * size_of::<usize>()
);
assert!(
offset_of!(ZSTD_rust_compressStream2ResultPolicyState, input)
== 3 * size_of::<usize>()
offset_of!(ZSTD_rust_compressStream2ResultPolicyState, input) == 3 * size_of::<usize>()
);
assert!(
offset_of!(ZSTD_rust_compressStream2ResultPolicyState, compress_result)
@@ -311,9 +307,7 @@ const _: () = {
out_buff_flushed_size
) == 6 * size_of::<usize>()
);
assert!(
size_of::<ZSTD_rust_compressStream2ResultPolicyState>() == 7 * size_of::<usize>()
);
assert!(size_of::<ZSTD_rust_compressStream2ResultPolicyState>() == 7 * size_of::<usize>());
};
#[inline]
@@ -14548,10 +14542,7 @@ mod tests {
out_buff_flushed_size: 5,
};
assert_eq!(
unsafe { ZSTD_rust_compressStream2ResultPolicy(&state) },
12
);
assert_eq!(unsafe { ZSTD_rust_compressStream2ResultPolicy(&state) }, 12);
assert_eq!(context.set_buffer_expectations_calls, 1);
}
+6 -19
View File
@@ -1705,10 +1705,7 @@ pub struct ZSTDMT_tryGetInputRangeResult {
const _: () = {
assert!(offset_of!(ZSTDMT_tryGetInputRangeResult, ready) == 0);
assert!(offset_of!(ZSTDMT_tryGetInputRangeResult, movePrefix) == size_of::<c_uint>());
assert!(
offset_of!(ZSTDMT_tryGetInputRangeResult, bufferStart)
== 2 * size_of::<c_uint>()
);
assert!(offset_of!(ZSTDMT_tryGetInputRangeResult, bufferStart) == 2 * size_of::<c_uint>());
assert!(
offset_of!(ZSTDMT_tryGetInputRangeResult, bufferCapacity)
== 2 * size_of::<c_uint>() + size_of::<*mut c_void>()
@@ -1723,11 +1720,8 @@ const _: () = {
);
};
pub type ZSTDMT_inputRangeWaitFn = unsafe extern "C" fn(
opaque: *mut c_void,
buffer_start: *mut c_void,
buffer_capacity: usize,
);
pub type ZSTDMT_inputRangeWaitFn =
unsafe extern "C" fn(opaque: *mut c_void, buffer_start: *mut c_void, buffer_capacity: usize);
pub type ZSTDMT_inputRangeMovePrefixFn = unsafe extern "C" fn(
opaque: *mut c_void,
destination: *mut c_void,
@@ -1735,11 +1729,8 @@ pub type ZSTDMT_inputRangeMovePrefixFn = unsafe extern "C" fn(
size: usize,
round_buffer_pos: usize,
);
pub type ZSTDMT_inputRangePublishBufferFn = unsafe extern "C" fn(
opaque: *mut c_void,
buffer_start: *mut c_void,
buffer_capacity: usize,
);
pub type ZSTDMT_inputRangePublishBufferFn =
unsafe extern "C" fn(opaque: *mut c_void, buffer_start: *mut c_void, buffer_capacity: usize);
#[inline]
fn commit_input_range_with<W, M, P>(
@@ -9102,11 +9093,7 @@ mod tests {
assert_eq!(size, prefix.len());
assert_eq!(round_buffer_pos, prefix.len());
unsafe {
ptr::copy_nonoverlapping(
source.cast::<u8>(),
destination.cast::<u8>(),
size,
);
ptr::copy_nonoverlapping(source.cast::<u8>(), destination.cast::<u8>(), size);
}
move_events.borrow_mut().push("move");
},