Skip to content

Commit ff160d2

Browse files
committed
Make # format easier to discover
1 parent 87bb990 commit ff160d2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

alloc/src/fmt.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
//! format!("{value}", value=4); // => "4"
2020
//! format!("{} {}", 1, 2); // => "1 2"
2121
//! format!("{:04}", 42); // => "0042" with leading zeros
22+
//! format!("{:#?}", (100, 200)); // => "(
23+
//! // 100,
24+
//! // 200,
25+
//! // )"
2226
//! ```
2327
//!
2428
//! From these, you can see that the first argument is a format string. It is
@@ -163,7 +167,7 @@
163167
//! * `-` - Currently not used
164168
//! * `#` - This flag indicates that the "alternate" form of printing should
165169
//! be used. The alternate forms are:
166-
//! * `#?` - pretty-print the [`Debug`] formatting
170+
//! * `#?` - pretty-print the [`Debug`] formatting (newline and indent)
167171
//! * `#x` - precedes the argument with a `0x`
168172
//! * `#X` - precedes the argument with a `0x`
169173
//! * `#b` - precedes the argument with a `0b`

0 commit comments

Comments
 (0)