mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-16 09:35:07 +00:00
Document FormatSpec
fields (#6458)
This commit is contained in:
parent
627f475b91
commit
0252995973
1 changed files with 9 additions and 0 deletions
|
@ -188,14 +188,23 @@ impl FormatParse for FormatType {
|
|||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct FormatSpec {
|
||||
// Ex) `!s` in `'{!s}'`
|
||||
conversion: Option<FormatConversion>,
|
||||
// Ex) `*` in `'{:*^30}'`
|
||||
fill: Option<char>,
|
||||
// Ex) `<` in `'{:<30}'`
|
||||
align: Option<FormatAlign>,
|
||||
// Ex) `+` in `'{:+f}'`
|
||||
sign: Option<FormatSign>,
|
||||
// Ex) `#` in `'{:#x}'`
|
||||
alternate_form: bool,
|
||||
// Ex) `30` in `'{:<30}'`
|
||||
width: Option<usize>,
|
||||
// Ex) `,` in `'{:,}'`
|
||||
grouping_option: Option<FormatGrouping>,
|
||||
// Ex) `2` in `'{:.2}'`
|
||||
precision: Option<usize>,
|
||||
// Ex) `f` in `'{:+f}'`
|
||||
format_type: Option<FormatType>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue