Merge pull request #1756 from topecongiro/closure_block_indent_threshold

Use correct one line budget in rewrite_closure_block
This commit is contained in:
Nick Cameron 2017-07-04 18:21:11 +12:00 committed by GitHub
commit 960dd3242a
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
// 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));
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")
});
}