Skip to content

Commit 1245908

Browse files
committed
Add one more valid example for named format string identifier
1 parent 1924e9b commit 1245908

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/contributor/pages/code-style-guide.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,15 @@ format!(
366366
=== Captured versus uncaptured format string identifiers
367367

368368
We place no restriction on named format string identifiers.
369-
Both options below are considered valid.
369+
All options below are considered valid.
370370

371371
[source,rust]
372372
----
373373
let greetee = "world";
374374
375375
format!("Hello, {greetee}!");
376376
format!("Hello, {greetee}!", greetee = "universe");
377+
format!("Hello {name}, hello again {name}", name = greetee);
377378
----
378379

379380
// TODO: Do we allow mix-and-matching captured and named identifiers?

0 commit comments

Comments
 (0)