fix : width available

This commit is contained in:
Gaëtan Cassiers 2015-05-30 16:44:07 +02:00
parent 092d6be368
commit 38f421b764
2 changed files with 5 additions and 3 deletions

View File

@ -204,8 +204,9 @@ impl<'a> FmtVisitor<'a> {
.enumerate()
.map(|(i, item)| self.rewrite_expr(
item,
// for last line, -2 is for indent + ")", for other lines, -1 is for comma
if i == items.len() - 1 { width - 2 } else { config!(max_width) - indent - 1 },
// last line : given width (minus "("+")"), other lines : max_width
// (minus "("+","))
if i == items.len() - 1 { width - 2 } else { config!(max_width) - indent - 2 },
indent))
.collect();
let tactics = if item_strs.iter().any(|s| s.contains('\n')) {

View File

@ -2,8 +2,9 @@
fn foo() {
let a = (a, a, a, a, a);
let aaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaa, aaaaaaaaaa);
let aaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaa, aaaaaaaaaaaaaa);
let aaaaaaaaaaaaaaaaaaaaaa = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaaaaaaa,
aaaa);
}