Skip to content

Commit

Permalink
Improve grammar in documentation of format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
steffahn committed Jan 1, 2021
1 parent 206ee1e commit 2eb4ccd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/alloc/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,22 @@
//! `%`. The actual grammar for the formatting syntax is:
//!
//! ```text
//! format_string := <text> [ maybe-format <text> ] *
//! maybe-format := '{' '{' | '}' '}' | <format>
//! format_string := text [ maybe_format text ] *
//! maybe_format := '{' '{' | '}' '}' | format
//! format := '{' [ argument ] [ ':' format_spec ] '}'
//! 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 := identifier | '?' | ''
//! type := '' | '?' | 'x?' | 'X?' | identifier
//! count := parameter | integer
//! parameter := argument '$'
//! ```
//! In the above grammar, `text` may not contain any `'{'` or `'}'` characters.
//!
//! # Formatting traits
//!
Expand Down

0 comments on commit 2eb4ccd

Please sign in to comment.