remove nested in expr

This commit is contained in:
Folkert 2021-03-21 20:56:18 +01:00
parent 19f05c9db8
commit 197835b6ed
6 changed files with 26 additions and 80 deletions

View file

@ -75,7 +75,7 @@ impl<'a> Formattable<'a> for Expr<'a> {
expr: loc_subexpr, ..
}) => loc_subexpr.is_multiline(),
ParensAround(subexpr) | Nested(subexpr) => subexpr.is_multiline(),
ParensAround(subexpr) => subexpr.is_multiline(),
Closure(loc_patterns, loc_body) => {
// check the body first because it's more likely to be multiline
@ -298,9 +298,6 @@ impl<'a> Formattable<'a> for Expr<'a> {
sub_expr.format_with_options(buf, parens, newlines, indent);
}
Nested(nested_expr) => {
nested_expr.format_with_options(buf, parens, newlines, indent);
}
AccessorFunction(key) => {
buf.push('.');
buf.push_str(key);
@ -508,8 +505,6 @@ fn empty_line_before_expr<'a>(expr: &'a Expr<'a>) -> bool {
false
}
Nested(nested_expr) => empty_line_before_expr(nested_expr),
_ => false,
}
}