diff options
| author | Nick Cameron <nrc@ncameron.org> | 2017-10-17 15:10:54 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-17 15:10:54 +0530 |
| commit | 560b0541470345277a6b0d7c721ae91c0bfdd4ff (patch) | |
| tree | cb0fc8e4ceb34bc86501c6e959645f095677a45f /src | |
| parent | 043ddf146d095ac38ee6353c28c395f50ec3ba76 (diff) | |
| parent | 7cbdf35f630d52cd888adfb90707b8bb5f4954da (diff) | |
Merge pull request #2064 from topecongiro/issue-2063
Take width of return type into account for body shape of closure
Diffstat (limited to 'src')
| -rw-r--r-- | src/expr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/expr.rs b/src/expr.rs index dbaf1cceefc..8bef270cf76 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -585,8 +585,6 @@ fn rewrite_closure_fn_decl( }; let list_str = write_list(&item_vec, &fmt)?; let mut prefix = format!("{}|{}|", mover, list_str); - // 1 = space between `|...|` and body. - let extra_offset = extra_offset(&prefix, shape) + 1; if !ret_str.is_empty() { if prefix.contains('\n') { @@ -597,6 +595,8 @@ fn rewrite_closure_fn_decl( } prefix.push_str(&ret_str); } + // 1 = space between `|...|` and body. + let extra_offset = last_line_width(&prefix) + 1; Some((prefix, extra_offset)) } |
