]> git.lizzy.rs Git - rust.git/blobdiff - src/expr.rs
fix: don't force a newline after an empty where clause
[rust.git] / src / expr.rs
index ef7278a3a873aa26ae6e6ced12d69143ee5918ea..1ba879ccc1d315d1180bb1e8af612bf05574f36c 100644 (file)
@@ -124,6 +124,9 @@ pub(crate) fn format_expr(
         | ast::ExprKind::Loop(..)
         | ast::ExprKind::While(..) => to_control_flow(expr, expr_type)
             .and_then(|control_flow| control_flow.rewrite(context, shape)),
+        ast::ExprKind::ConstBlock(ref anon_const) => {
+            Some(format!("const {}", anon_const.rewrite(context, shape)?))
+        }
         ast::ExprKind::Block(ref block, opt_label) => {
             match expr_type {
                 ExprType::Statement => {