|
218 | 218 | //! } |
219 | 219 | //! ``` |
220 | 220 | //! |
221 | | -//! ### fmt::Display vs fmt::Debug |
| 221 | +//! ### `fmt::Display` vs `fmt::Debug` |
222 | 222 | //! |
223 | 223 | //! These two formatting traits have distinct purposes: |
224 | 224 | //! |
|
358 | 358 | //! to ensure padding is applied is to format your input, then use this |
359 | 359 | //! resulting string to pad your output. |
360 | 360 | //! |
361 | | -//! ## Sign/#/0 |
| 361 | +//! ## Sign/`#`/`0` |
362 | 362 | //! |
363 | 363 | //! These can all be interpreted as flags for a particular formatter. |
364 | 364 | //! |
365 | | -//! * '+' - This is intended for numeric types and indicates that the sign |
| 365 | +//! * `+` - This is intended for numeric types and indicates that the sign |
366 | 366 | //! should always be printed. Positive signs are never printed by |
367 | 367 | //! default, and the negative sign is only printed by default for the |
368 | | -//! `Signed` trait. This flag indicates that the correct sign (+ or -) |
| 368 | +//! `Signed` trait. This flag indicates that the correct sign (`+` or `-`) |
369 | 369 | //! should always be printed. |
370 | | -//! * '-' - Currently not used |
371 | | -//! * '#' - This flag is indicates that the "alternate" form of printing should |
| 370 | +//! * `-` - Currently not used |
| 371 | +//! * `#` - This flag is indicates that the "alternate" form of printing should |
372 | 372 | //! be used. The alternate forms are: |
373 | 373 | //! * `#?` - pretty-print the `Debug` formatting |
374 | | -//! * `#x` - precedes the argument with a "0x" |
375 | | -//! * `#X` - precedes the argument with a "0x" |
376 | | -//! * `#b` - precedes the argument with a "0b" |
377 | | -//! * `#o` - precedes the argument with a "0o" |
378 | | -//! * '0' - This is used to indicate for integer formats that the padding should |
| 374 | +//! * `#x` - precedes the argument with a `0x` |
| 375 | +//! * `#X` - precedes the argument with a `0x` |
| 376 | +//! * `#b` - precedes the argument with a `0b` |
| 377 | +//! * `#o` - precedes the argument with a `0o` |
| 378 | +//! * `0` - This is used to indicate for integer formats that the padding should |
379 | 379 | //! both be done with a `0` character as well as be sign-aware. A format |
380 | 380 | //! like `{:08}` would yield `00000001` for the integer `1`, while the |
381 | 381 | //! same format would yield `-0000001` for the integer `-1`. Notice that |
|
390 | 390 | //! |
391 | 391 | //! The default fill/alignment for non-numerics is a space and left-aligned. The |
392 | 392 | //! defaults for numeric formatters is also a space but with right-alignment. If |
393 | | -//! the '0' flag is specified for numerics, then the implicit fill character is |
394 | | -//! '0'. |
| 393 | +//! the `0` flag is specified for numerics, then the implicit fill character is |
| 394 | +//! `0`. |
395 | 395 | //! |
396 | 396 | //! The value for the width can also be provided as a `usize` in the list of |
397 | 397 | //! parameters by using the `2$` syntax indicating that the second argument is a |
|
0 commit comments