Rollup merge of #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.
This commit is contained in:
Matthias Krüger 2025-07-18 14:49:19 +02:00 committed by GitHub
commit 744ca5959a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -348,13 +348,13 @@
//! format := '{' [ argument ] [ ':' format_spec ] [ ws ] * '}'
//! argument := integer | identifier
//!
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision]type
//! format_spec := [[fill]align][sign]['#']['0'][width]['.' precision][type]
//! fill := character
//! align := '<' | '^' | '>'
//! sign := '+' | '-'
//! width := count
//! precision := count | '*'
//! type := '' | '?' | 'x?' | 'X?' | identifier
//! type := '?' | 'x?' | 'X?' | identifier
//! count := parameter | integer
//! parameter := argument '$'
//! ```