]> git.lizzy.rs Git - rust.git/blobdiff - library/alloc/src/fmt.rs
Auto merge of #78618 - workingjubilee:ieee754-fmt, r=m-ou-se
[rust.git] / library / alloc / src / fmt.rs
index 439b0adde20155b8498c9aa0f62b39d5f00cb1e9..3ef55f06e51989985409664bf1dd7aff240fcaf8 100644 (file)
 //! format!("{value}", value=4);      // => "4"
 //! format!("{} {}", 1, 2);           // => "1 2"
 //! format!("{:04}", 42);             // => "0042" with leading zeros
+//! format!("{:#?}", (100, 200));     // => "(
+//!                                   //       100,
+//!                                   //       200,
+//!                                   //     )"
 //! ```
 //!
 //! From these, you can see that the first argument is a format string. It is
 //! * `-` - Currently not used
 //! * `#` - This flag indicates that the "alternate" form of printing should
 //!         be used. The alternate forms are:
-//!     * `#?` - pretty-print the [`Debug`] formatting
+//!     * `#?` - pretty-print the [`Debug`] formatting (adds linebreaks and indentation)
 //!     * `#x` - precedes the argument with a `0x`
 //!     * `#X` - precedes the argument with a `0x`
 //!     * `#b` - precedes the argument with a `0b`