Skip to content

Commit c0ca280

Browse files
Rollup merge of rust-lang#132393 - zedddie16:issue-131865-fix, r=tgross35
Docs: added brief colon explanation rust-lang#131865 (this is my first attempt at contributing, feedback is welcome)
2 parents 8ccb78e + c7b07d5 commit c0ca280

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/alloc/src/fmt.rs

+10
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@
109109
//! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These
110110
//! parameters affect the string representation of what's being formatted.
111111
//!
112+
//! The colon `:` in format syntax divides indentifier of the input data and
113+
//! the formatting options, the colon itself does not change anything, only
114+
//! introduces the options.
115+
//!
116+
//! ```
117+
//! let a = 5;
118+
//! let b = &a;
119+
//! println!("{a:e} {b:p}"); // => 5e0 0x7ffe37b7273c
120+
//! ```
121+
//!
112122
//! ## Width
113123
//!
114124
//! ```

0 commit comments

Comments
 (0)