about summary refs log tree commit diff
diff options
context:
space:
mode:
authortuturuu <zedddiezxc@gmail.com>2024-10-31 08:23:50 +0100
committertuturuu <zedddiezxc@gmail.com>2024-11-02 20:49:24 +0100
commitc7b07d58c32d015e8f26da0bd3defd6898aac2b7 (patch)
tree36a235868a1700465247346a475762b8d395d9ea
parent00ed73cdc09a6452cb58202d56a9211fb3c73031 (diff)
downloadrust-c7b07d58c32d015e8f26da0bd3defd6898aac2b7.tar.gz
rust-c7b07d58c32d015e8f26da0bd3defd6898aac2b7.zip
Rustdoc: added brief colon explanation
-rw-r--r--library/alloc/src/fmt.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs
index 3da71038a5e..695dddb25ee 100644
--- a/library/alloc/src/fmt.rs
+++ b/library/alloc/src/fmt.rs
@@ -109,6 +109,16 @@
 //! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These
 //! parameters affect the string representation of what's being formatted.
 //!
+//! The colon `:` in format syntax divides indentifier of the input data and
+//! the formatting options, the colon itself does not change anything, only
+//! introduces the options.
+//!
+//! ```
+//! let a = 5;
+//! let b = &a;
+//! println!("{a:e} {b:p}"); // => 5e0 0x7ffe37b7273c
+//! ```
+//!
 //! ## Width
 //!
 //! ```