I have a type that has a map of vectors of pairs of ... and I'm implementing Debug
manually to be able to provide better output than the default.
"Alternate form" (e.g. {:#?}
) is really helpful to generate more readable output, but for this type it generates something like
{
i0: [
(
i2,
i4,
),
(
i0,
i1,
),
],
i1: [],
i2: [
(
i2,
i3,
),
],
i3: [
(
i3,
i4,
),
],
}
Ideally I want to generate
{
i0: [ (i2, i4), (i0, i1) ],
i1: [],
i2: [ (i2, i3) ],
i3: [ (i3, i4) ],
}
I don't care about trailing commas or whitespace around brackets -- I just want to use the compact layout for some parts, while using the alternate for for others. Is there a way to switch between these two modes in a Debug
impl (in the fmt
method) ?
Thanks.