(buf: &mut W, len: usize)
| 763 | } |
| 764 | |
| 765 | pub(crate) fn write_len<W: Write>(buf: &mut W, len: usize) { |
| 766 | let Ok(len) = len.try_into() else { |
| 767 | panic!("too long to serialize") |
| 768 | }; |
| 769 | buf.write_u32(len); |
| 770 | } |
| 771 | |
| 772 | pub(crate) fn write_vec<W: Write>(buf: &mut W, slice: &[u8]) { |
| 773 | write_len(buf, slice.len()); |
no test coverage detected