Skip to content

Commit acca4b8

Browse files
committedAug 21, 2022
Extra documentation for new formatting feature
High traffic macros should detail this helpful addition.
1 parent 650bff8 commit acca4b8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎library/alloc/src/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ macro_rules! vec {
107107
/// format!("test");
108108
/// format!("hello {}", "world!");
109109
/// format!("x = {}, y = {y}", 10, y = 30);
110+
/// let (x, y) = (1, 2);
111+
/// format!("{x} + {y} = 3");
110112
/// ```
111113
#[macro_export]
112114
#[stable(feature = "rust1", since = "1.0.0")]

‎library/std/src/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ macro_rules! print {
9393
/// println!(); // prints just a newline
9494
/// println!("hello there!");
9595
/// println!("format {} arguments", "some");
96+
/// let local_variable = "some";
97+
/// println!("format {local_variable} arguments");
9698
/// ```
9799
#[macro_export]
98100
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)
Please sign in to comment.