pub fn format_array<F, T, E>(
    buf: &mut F,
    dims: &[ArrayDimension],
    elems: impl IntoIterator<Item = T>,
    format_elem: impl FnMut(ListElementWriter<'_, F>, T) -> Result<Nestable, E>
) -> Result<Nestable, E> where
    F: FormatBuffer