use super::put_u32;
#[inline]
pub fn put_len_u32(out: &mut Vec<u8>, value: usize, label: &str) -> Result<(), String> {
let encoded = u32::try_from(value).map_err(|error| {
format!("{label} {value} exceeds u32::MAX: {error}. Fix: split the Program before IR wire-format serialization.")
})?;
put_u32(out, encoded);
Ok(())
}