Re-use expr formatter for constants.
This commit is contained in:
parent
f35afe8d65
commit
9063549f2e
|
@ -295,7 +295,7 @@ impl<'comments> Formatter<'comments> {
|
|||
|
||||
head.append(" =")
|
||||
.append(break_("", " "))
|
||||
.append(self.const_expr(value))
|
||||
.append(self.expr(value, true))
|
||||
.nest(INDENT)
|
||||
.group()
|
||||
}
|
||||
|
@ -338,12 +338,6 @@ impl<'comments> Formatter<'comments> {
|
|||
})
|
||||
}
|
||||
|
||||
fn const_expr<'a>(&mut self, _value: &'a UntypedExpr) -> Document<'a> {
|
||||
todo!(
|
||||
"format const_expr: surround complex expressions with a block, and leave simple expression without"
|
||||
);
|
||||
}
|
||||
|
||||
pub fn docs_const_expr<'a>(&mut self, name: &'a str, value: &'a TypedExpr) -> Document<'a> {
|
||||
let mut printer = tipo::pretty::Printer::new();
|
||||
name.to_doc()
|
||||
|
|
Loading…
Reference in New Issue