Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using captured identifiers for print macros #3047

Closed
nyurik opened this issue Feb 6, 2022 · 1 comment
Closed

Using captured identifiers for print macros #3047

nyurik opened this issue Feb 6, 2022 · 1 comment
Milestone

Comments

@nyurik
Copy link
Contributor

nyurik commented Feb 6, 2022

v1.58 introduces captured identifiers in format strings, and yet it seems most of the examples in the book still use positional placeholders. Is this intentional, or should I submit a pull request modifying some of those usages? Thx!

nyurik added a commit to nyurik/book that referenced this issue Feb 6, 2022
Per rust-lang#3047, use captured identifiers instead of the positional ones for some examples, e.g.

```diff
-  println!("Worker {} got a job; executing.", id);
+  println!("Worker {id} got a job; executing.");
```
@carols10cents carols10cents added this to the all milestone Feb 10, 2022
nyurik added a commit to nyurik/book that referenced this issue Mar 28, 2023
Per rust-lang#3047, use captured identifiers instead of the positional ones for some examples, e.g.

```diff
-  println!("Worker {} got a job; executing.", id);
+  println!("Worker {id} got a job; executing.");
```
nyurik added a commit to nyurik/book that referenced this issue Oct 30, 2023
Per rust-lang#3047, use captured identifiers instead of the positional ones for some examples, e.g.

```diff
-  println!("Worker {} got a job; executing.", id);
+  println!("Worker {id} got a job; executing.");
```
@chriskrycho
Copy link
Contributor

Thanks for filing this and for all the PRs to implement! Going to go ahead and close it out now that we landed those! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants