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

Method fmt

crates/ruff_python_parser/src/parser/statement.rs:4091–4106  ·  view source on GitHub ↗
(&self, f: &mut std::fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

4089
4090impl Display for Clause {
4091 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4092 match self {
4093 Clause::If => write!(f, "`if` statement"),
4094 Clause::Else => write!(f, "`else` clause"),
4095 Clause::ElIf => write!(f, "`elif` clause"),
4096 Clause::For => write!(f, "`for` statement"),
4097 Clause::With => write!(f, "`with` statement"),
4098 Clause::Class => write!(f, "`class` definition"),
4099 Clause::While => write!(f, "`while` statement"),
4100 Clause::FunctionDef => write!(f, "function definition"),
4101 Clause::Case => write!(f, "`case` block"),
4102 Clause::Try => write!(f, "`try` statement"),
4103 Clause::Except => write!(f, "`except` clause"),
4104 Clause::Finally => write!(f, "`finally` clause"),
4105 }
4106 }
4107}
4108
4109/// The classification of the `match` token.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected