Resolve precedence clippy lint

error: operator precedence can trip the unwary
      --> src/udiv128.rs:15:17
       |
    15 |     let high2 = x_hi as u128 * y_lo as u128 + m_lo as u128 >> 64;
       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(x_hi as u128 * y_lo as u128 + m_lo as u128) >> 64`
       |
       = note: `-D clippy::precedence` implied by `-D clippy::all`
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
This commit is contained in:
David Tolnay 2021-12-11 00:51:31 -08:00
parent 3091ce69da
commit fb7a827f32
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ fn u128_mulhi(x: u128, y: u128) -> u128 {
let high1 = m >> 64;
let m_lo = m as u64;
let high2 = x_hi as u128 * y_lo as u128 + m_lo as u128 >> 64;
let high2 = (x_hi as u128 * y_lo as u128 + m_lo as u128) >> 64;
x_hi as u128 * y_hi as u128 + high1 + high2
}