]> git.lizzy.rs Git - rust.git/commitdiff
Use correct one line budget for array in Block indent style
authortopecongiro <seuchida@gmail.com>
Wed, 5 Jul 2017 10:19:54 +0000 (19:19 +0900)
committertopecongiro <seuchida@gmail.com>
Wed, 5 Jul 2017 10:19:54 +0000 (19:19 +0900)
src/expr.rs

index dff1521f14a00a320cdee6f14ca9a47d076996c3..81168b3618c678c0d2aac9af51585aaa80b9a970 100644 (file)
@@ -464,8 +464,16 @@ pub fn rewrite_array<'a, I>(
         1 // "["
     };
 
-    let nested_shape = match context.config.array_layout() {
-        IndentStyle::Block => shape.block().block_indent(context.config.tab_spaces()),
+    let mut nested_shape = match context.config.array_layout() {
+        IndentStyle::Block => {
+            try_opt!(
+                shape
+                    .block()
+                    .block_indent(context.config.tab_spaces())
+                    .with_max_width(context.config)
+                    .sub_width(1)
+            )
+        }
         IndentStyle::Visual => {
             try_opt!(
                 shape