Skip to content

Commit

Permalink
Extra documentation for new formatting feature
Browse files Browse the repository at this point in the history
High traffic macros should detail this helpful addition.
  • Loading branch information
IsaacCloos committed Aug 21, 2022
1 parent 650bff8 commit acca4b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/alloc/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ macro_rules! vec {
/// format!("test");
/// format!("hello {}", "world!");
/// format!("x = {}, y = {y}", 10, y = 30);
/// let (x, y) = (1, 2);
/// format!("{x} + {y} = 3");
/// ```
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
2 changes: 2 additions & 0 deletions library/std/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ macro_rules! print {
/// println!(); // prints just a newline
/// println!("hello there!");
/// println!("format {} arguments", "some");
/// let local_variable = "some";
/// println!("format {local_variable} arguments");
/// ```
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit acca4b8

Please sign in to comment.