mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-04 10:49:55 +00:00
specialize ConversionFlag (#42)
* specialize ConversionFlag * Change value of ConversionFlag to i8 and None to -1 * is_* methods to ConversionFlag
This commit is contained in:
parent
611dcc2e9b
commit
9d47d3d212
29 changed files with 60 additions and 104 deletions
|
@ -13,6 +13,7 @@ ruff_text_size = { path = "../ruff_text_size" }
|
|||
ruff_source_location = { path = "../ruff_source_location", optional = true }
|
||||
|
||||
serde = { version = "1.0.133", optional = true, default-features = false, features = ["derive"] }
|
||||
is-macro.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/// Transforms a value prior to formatting it.
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
#[repr(u8)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, is_macro::Is)]
|
||||
#[repr(i8)]
|
||||
pub enum ConversionFlag {
|
||||
/// No conversion
|
||||
None = 0, // CPython uses -1 but not pleasure for us
|
||||
None = -1, // CPython uses -1
|
||||
/// Converts by calling `str(<value>)`.
|
||||
Str = b's',
|
||||
Str = b's' as i8,
|
||||
/// Converts by calling `ascii(<value>)`.
|
||||
Ascii = b'a',
|
||||
Ascii = b'a' as i8,
|
||||
/// Converts by calling `repr(<value>)`.
|
||||
Repr = b'r',
|
||||
Repr = b'r' as i8,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue