Skip to main content

print_long_array

Function print_long_array 

Source
fn print_long_array(
    array: &dyn Array,
    f: &mut Formatter<'_>,
    print_item: &mut dyn FnMut(usize, &mut Formatter<'_>) -> Result,
) -> Result
Expand description

Helper function for printing potentially long arrays.

Note this function is deliberately not generic over the array or closure type: it is called from Debug impls that are instantiated for many concrete array types, and using dynamic dispatch here avoids duplicating this function’s code in each of those instantiations