about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authortopecongiro <seuchida@gmail.com>2017-04-19 10:14:27 +0900
committertopecongiro <seuchida@gmail.com>2017-05-01 15:36:40 +0900
commit3d2cd681ae76d0c1444238d54384e1d3cb3d35fc (patch)
tree39cbbb8bd35dd5d373a3ced63fec5d9c4b494bb2 /src
parent02c9ac93be959272ffbb3fbbec79dbe9fc734140 (diff)
Use 'first_line_width'
Diffstat (limited to 'src')
-rw-r--r--src/chains.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/chains.rs b/src/chains.rs
index 9dabf2d0322..a2485cab69f 100644
--- a/src/chains.rs
+++ b/src/chains.rs
@@ -203,8 +203,7 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) -
                                                          shape) {
                         // If the first line of the last method does not fit into a single line
                         // after the others, allow new lines.
-                        let first_line = try_opt!(last[0].lines().nth(0));
-                        almost_total + first_line.len() < context.config.max_width
+                        almost_total + first_line_width(&last[0]) < context.config.max_width
                     } else {
                         false
                     }