INNER CODE UNIT · Rust
serialize_array
renegade-fi/renegade · crates/circuits/circuit-types/src/lib.rs:228
pub fn serialize_array<const ARR_SIZE: usize, T, S>(
arr: &[T; ARR_SIZE],
s: S,
) -> Result<S::Ok, S::Error>
where
S: Serializer,
T: Serialize + Clone,
[(); ARR_SIZE]: Sized,
{
// Convert the array to a vec
let arr_vec: Vec<T> = arr.clone().into();
arr_vec.serialize(s)
}
/// A helper for deserializing array types
pub fn deserialize_array<'de, const ARR_SIZE: usize, T, D>(d: D) -> Result<[T; ARR_SIZE], D::Error>
where
D: Deserializer<'de>,