Fix width computation in rewrite_binary_op
Operator width was counted twice.
This commit is contained in:
parent
8461e8a0a8
commit
ff301efa4e
3 changed files with 4 additions and 3 deletions
|
@ -608,7 +608,7 @@ fn rewrite_binary_op(context: &RewriteContext,
|
|||
result.push_str(&operator_str);
|
||||
|
||||
// 1 = space between operator and rhs
|
||||
let used_width = result.len() + operator_str.len() + 1;
|
||||
let used_width = result.len() + 1;
|
||||
let remaining_width = match result.rfind('\n') {
|
||||
Some(idx) => (offset + width + idx).checked_sub(used_width).unwrap_or(0),
|
||||
None => width.checked_sub(used_width).unwrap_or(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue