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

Method unparse_match_case

crates/ruff_python_codegen/src/generator.rs:863–872  ·  view source on GitHub ↗
(&mut self, ast: &MatchCase)

Source from the content-addressed store, hash-verified

861 }
862
863 fn unparse_match_case(&mut self, ast: &MatchCase) {
864 self.p("case ");
865 self.unparse_pattern(&ast.pattern);
866 if let Some(guard) = &ast.guard {
867 self.p(" if ");
868 self.unparse_expr(guard, precedence::MAX);
869 }
870 self.p(":");
871 self.body(&ast.body);
872 }
873
874 fn unparse_type_params(&mut self, type_params: &TypeParams) {
875 self.p("[");

Callers

nothing calls this directly

Calls 4

pMethod · 0.80
unparse_patternMethod · 0.80
unparse_exprMethod · 0.45
bodyMethod · 0.45

Tested by

no test coverage detected