Closed
Description
What needs to be fixed?
One of the code samples is written as
// You can pad numbers with extra zeroes. This will output "000001".
println!("{number:>0width$}", number=1, width=6);
This won't actually pad the string with zeroes, it'll actually output " 1".
Page(s) Affected
https://doc.rust-lang.org/stable/rust-by-example/hello/print.html
Suggested Improvement
Update the code snippet to
// You can pad numbers with extra zeroes. This will output "000001".
println!("{number:0>width$}", number=1, width=6);
Metadata
Metadata
Assignees
Labels
No labels