(
buf: &mut F,
elems: impl IntoIterator<Item = T>,
format_elem: impl FnMut(ListElementWriter<F>, T) -> Result<Nestable, E>,
)
| 1668 | } |
| 1669 | |
| 1670 | pub fn format_list<F, T, E>( |
| 1671 | buf: &mut F, |
| 1672 | elems: impl IntoIterator<Item = T>, |
| 1673 | format_elem: impl FnMut(ListElementWriter<F>, T) -> Result<Nestable, E>, |
| 1674 | ) -> Result<Nestable, E> |
| 1675 | where |
| 1676 | F: FormatBuffer, |
| 1677 | { |
| 1678 | buf.write_char('{'); |
| 1679 | format_elems(buf, elems, format_elem, ',')?; |
| 1680 | buf.write_char('}'); |
| 1681 | Ok(Nestable::Yes) |
| 1682 | } |
| 1683 | |
| 1684 | /// Writes each `elem` into `buf`, separating the elems with `sep`. |
| 1685 | pub fn format_elems<F, T, E>( |