Rust tips @rust@octodon.social
Follow

debug print format `{:?}` prints the whole expression in one line.

There's a pretty-print `{:#?}` which prints structs and vectors in a nice multi-line indented format.

println!("{:#?}", complex_value);

If you're implementing Debug trait for your types manually, check out Formatter methods to support pretty-printing:

doc.rust-lang.org/std/fmt/stru

· Web · 5 · 4