We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f3d925 commit 68da44eCopy full SHA for 68da44e
src/expr.rs
@@ -855,11 +855,17 @@ impl Rewrite for ast::Block {
855
}
856
857
let prefix = try_opt!(block_prefix(context, self, shape));
858
- if let rw @ Some(_) = rewrite_single_line_block(context, &prefix, self, shape) {
859
- return rw;
+
+ let result = rewrite_block_with_visitor(context, &prefix, self, shape);
860
+ if let Some(ref result_str) = result {
861
+ if result_str.lines().count() <= 3 {
862
+ if let rw @ Some(_) = rewrite_single_line_block(context, &prefix, self, shape) {
863
+ return rw;
864
+ }
865
866
867
- rewrite_block_with_visitor(context, &prefix, self, shape)
868
+ result
869
870
871
0 commit comments