diff options
| author | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2015-08-19 21:53:02 +0200 |
|---|---|---|
| committer | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2015-08-19 21:53:02 +0200 |
| commit | 8dbe2133fb342c0db21a583d10c2882a42f2e869 (patch) | |
| tree | 2083708c88a4efb64ac462f03b29fc687a704c6d /src/expr.rs | |
| parent | 2ef0b179558f85a0a0288d8fa1500732cd2512d5 (diff) | |
| parent | 8e22a73cb73db27e4d4e30b263839164c97efcd6 (diff) | |
Merge pull request #178 from marcusklaas/single-config-override
Allow override of single configuration lines in tests
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/expr.rs b/src/expr.rs index 1dfff001475..2fbdcb7d6c9 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -617,10 +617,8 @@ fn rewrite_binary_op(context: &RewriteContext, let operator_str = context.codemap.span_to_snippet(op.span).unwrap(); // 1 = space between lhs expr and operator - let mut result = - try_opt!(lhs.rewrite(context, - context.config.max_width - offset - 1 - operator_str.len(), - offset)); + let max_width = try_opt!(context.config.max_width.checked_sub(operator_str.len() + offset + 1)); + let mut result = try_opt!(lhs.rewrite(context, max_width, offset)); result.push(' '); result.push_str(&operator_str); |
