Skip to content

Commit 43594c1

Browse files
authored
Rollup merge of rust-lang#34462 - dns2utf8:leading_zeros, r=GuillaumeGomez
Add example with leading zeros I was searching for this format very long. So I added an example to the prominent section. I was thinking of putting the keyword leading in the corresponding section as well, what do you think? r? @steveklabnik
2 parents 90f2894 + 6418cb4 commit 43594c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcollections/fmt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
//! format!("{:?}", (3, 4)); // => "(3, 4)"
2929
//! format!("{value}", value=4); // => "4"
3030
//! format!("{} {}", 1, 2); // => "1 2"
31+
//! format!("{:04}", 42); // => "0042" with leading zeros
3132
//! ```
3233
//!
3334
//! From these, you can see that the first argument is a format string. It is

0 commit comments

Comments
 (0)