MCPcopy Create free account
hub / github.com/apache/fory / validate_array_length

Function validate_array_length

rust/fory-core/src/serializer/array.rs:41–49  ·  view source on GitHub ↗
(actual: usize, expected: usize)

Source from the content-addressed store, hash-verified

39/// Validates that the deserialized length matches the expected array size N.
40#[inline(always)]
41fn validate_array_length(actual: usize, expected: usize) -> Result<(), Error> {
42 if actual != expected {
43 return Err(Error::invalid_data(format!(
44 "Array length mismatch: expected {}, got {}",
45 expected, actual
46 )));
47 }
48 Ok(())
49}
50
51/// Converts initialized MaybeUninit array to a regular array.
52/// # Safety

Callers 2

read_primitive_arrayFunction · 0.85
read_complex_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected