1
Fork 0

Add option to override single configuration lines for tests

This commit is contained in:
Marcus Klaas 2015-08-19 21:41:19 +02:00
parent 2ef0b17955
commit 8e22a73cb7
14 changed files with 110 additions and 116 deletions

View file

@ -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);