Skip to content

Commit 119597a

Browse files
authored
Rollup merge of rust-lang#143909 - nik-rev:patch-1, r=jhpratt
docs(alloc::fmt): Make type optional, instead of matching empty string Think this is clearer. Noticed as I was implementing [`tree-sitter-rust-format-args`](https://github.com/nik-rev/tree-sitter-rust-format-args), and attempting to match the empty string results in an error.
2 parents fe8be86 + f5485e5 commit 119597a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/alloc/src/fmt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@
348348
//! format := '{' [ argument ] [ ':' format_spec ] [ ws ] * '}'
349349
//! argument := integer | identifier
350350
//!
351-
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision]type
351+
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision][type]
352352
//! fill := character
353353
//! align := '<' | '^' | '>'
354354
//! sign := '+' | '-'
355355
//! width := count
356356
//! precision := count | '*'
357-
//! type := '' | '?' | 'x?' | 'X?' | identifier
357+
//! type := '?' | 'x?' | 'X?' | identifier
358358
//! count := parameter | integer
359359
//! parameter := argument '$'
360360
//! ```

0 commit comments

Comments
 (0)