Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0278cab

Browse filesBrowse files
authored
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 714115a + 81b20e0 commit 0278cab
Copy full SHA for 0278cab

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎alloc/src/fmt.rs

Copy file name to clipboardExpand all lines: alloc/src/fmt.rs
+10Lines changed: 10 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.