Use correct one line budget in rewrite_closure_block

This commit is contained in:
topecongiro 2017-06-28 10:56:29 +09:00
parent f028cbe760
commit 0199e08367
3 changed files with 13 additions and 1 deletions

View File

@ -750,7 +750,7 @@ fn rewrite_closure_block(
// The body of the closure is big enough to be block indented, that // The body of the closure is big enough to be block indented, that
// means we must re-format. // means we must re-format.
let block_shape = shape.block().with_max_width(context.config); let block_shape = shape.block();
let block_str = try_opt!(block.rewrite(&context, block_shape)); let block_str = try_opt!(block.rewrite(&context, block_shape));
Some(format!("{} {}", prefix, block_str)) Some(format!("{} {}", prefix, block_str))
} }

View File

@ -0,0 +1,5 @@
// rustfmt-closure_block_indent_threshold: -1
fn issue1755() {
b.iter(|| dfkljdklgjdlkfgjdlkgjldkjfgkdjgldjfgkljdfklgjlkdjfgkljdflkgjlkdfjgdjfsas::expect("parse"));
}

View File

@ -0,0 +1,7 @@
// rustfmt-closure_block_indent_threshold: -1
fn issue1755() {
b.iter(|| {
dfkljdklgjdlkfgjdlkgjldkjfgkdjgldjfgkljdfklgjlkdjfgkljdflkgjlkdfjgdjfsas::expect("parse")
});
}