feat: add prettifier for Pat

This commit is contained in:
roife 2024-09-09 03:52:04 +08:00
parent 5004371a4a
commit 60c42c25c7
2 changed files with 31 additions and 0 deletions

View file

@ -227,6 +227,17 @@ impl Body {
pretty::print_expr_hir(db, self, owner, expr, edition)
}
pub fn pretty_print_pat(
&self,
db: &dyn DefDatabase,
owner: DefWithBodyId,
pat: PatId,
oneline: bool,
edition: Edition,
) -> String {
pretty::print_pat_hir(db, self, owner, pat, oneline, edition)
}
fn new(
db: &dyn DefDatabase,
owner: DefWithBodyId,