Rust String Formatting - An ASCII-Art Cheatsheet!
For once a post of a different kind. Let's talk about the versatile Rust String formatting and how to use it. The ASCII-Art shows the different elements in the format!()
, print!()
and println!()
macros.
For example what is the output of the following code?
print!("{0:*>+10.3e}", std::f64::consts::E);