MCPcopy Create free account
hub / github.com/astral-sh/ruff / fmt

Method fmt

crates/ruff_python_formatter/src/string/mod.rs:20–29  ·  view source on GitHub ↗
(&self, f: &mut PyFormatter)

Source from the content-addressed store, hash-verified

18
19impl 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)]

Callers 2

formatFunction · 0.45
print_oneMethod · 0.45

Calls 3

tokenFunction · 0.85
OkClass · 0.85
as_strMethod · 0.45

Tested by

no test coverage detected