(&self, f: &mut PyFormatter)
| 18 | |
| 19 | impl Format<PyFormatContext<'_>> for AnyStringPrefix { |
| 20 | fn fmt(&self, f: &mut PyFormatter) -> FormatResult<()> { |
| 21 | // Remove the unicode prefix `u` if any because it is meaningless in Python 3+. |
| 22 | if !matches!( |
| 23 | self, |
| 24 | AnyStringPrefix::Regular(StringLiteralPrefix::Empty | StringLiteralPrefix::Unicode) |
| 25 | ) { |
| 26 | token(self.as_str()).fmt(f)?; |
| 27 | } |
| 28 | Ok(()) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | #[derive(Copy, Clone, Debug)] |