Like {:0>6} for alignment of a normal debug or display print, is there a way to align a pretty print with {:#?} in Rust?
Tried:
println!("{:#?0>6}", 123);
Expected the output:
000123
6}", 1" /> 6}", 1" /> 6}", 1"/>
Like {:0>6} for alignment of a normal debug or display print, is there a way to align a pretty print with {:#?} in Rust?
Tried:
println!("{:#?0>6}", 123);
Expected the output:
000123
Copyright © 2021 Jogjafile Inc.
Yes, you just have to use the correct syntax as specified in the documentation:
i.e.
#has to come after>wihch is youralignand before6which is yourwidthand thetype(?forDebug) has to come last.So for your example that would be: