Skip to content

Commit b02ff8f

Browse files
committed
Add explanation to named vs unnamed fmt string identifiers
1 parent 1f45821 commit b02ff8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ enum Error {
314314
=== Named versus unnamed format string identifiers
315315

316316
For simple string formatting (up to two substitutions), we allow unnamed (and thus also uncaptured) identifiers.
317-
For more complex formatting (more than two substitutions), we require named identifiers.
317+
For more complex formatting (more than two substitutions), we require named identifiers to avoid ambiguity, and to decouple argument order from the text (which can lead to incorrect text when the wording is changed and `{}` are reordered while the arguments aren't).
318318
Mix-and-matching of named versus unnamed identifiers must be avoided.
319319
See the next section about captured versus uncaptured identifiers.
320320

0 commit comments

Comments
 (0)