Commit 1e77cac
committed
Resolve precedence clippy lint
warning: operator precedence can trip the unwary
--> src/read.rs:963:18
|
963 | let n = (((n1 - 0xD800) as u32) << 10 | (n2 - 0xDC00) as u32) + 0x1_0000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(((n1 - 0xD800) as u32) << 10) | (n2 - 0xDC00) as u32`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
= note: `-W clippy::precedence` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::precedence)]`
warning: operator precedence can trip the unwary
--> src/read.rs:991:28
|
991 | ptr.write((n >> 6 & 0b0001_1111) as u8 | 0b1100_0000);
| ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 6) & 0b0001_1111`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
warning: operator precedence can trip the unwary
--> src/read.rs:995:28
|
995 | ptr.write((n >> 12 & 0b0000_1111) as u8 | 0b1110_0000);
| ^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 12) & 0b0000_1111`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
warning: operator precedence can trip the unwary
--> src/read.rs:996:35
|
996 | ptr.add(1).write((n >> 6 & 0b0011_1111) as u8 | 0b1000_0000);
| ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 6) & 0b0011_1111`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
warning: operator precedence can trip the unwary
--> src/read.rs:1000:28
|
1000 | ptr.write((n >> 18 & 0b0000_0111) as u8 | 0b1111_0000);
| ^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 18) & 0b0000_0111`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
warning: operator precedence can trip the unwary
--> src/read.rs:1002:29
|
1002 | .write((n >> 12 & 0b0011_1111) as u8 | 0b1000_0000);
| ^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 12) & 0b0011_1111`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
warning: operator precedence can trip the unwary
--> src/read.rs:1003:35
|
1003 | ptr.add(2).write((n >> 6 & 0b0011_1111) as u8 | 0b1000_0000);
| ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(n >> 6) & 0b0011_1111`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence1 parent b2a1415 commit 1e77cac
1 file changed
+9
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
963 | | - | |
| 963 | + | |
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
| |||
988 | 988 | | |
989 | 989 | | |
990 | 990 | | |
991 | | - | |
| 991 | + | |
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
995 | | - | |
996 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
997 | 998 | | |
998 | 999 | | |
999 | 1000 | | |
1000 | | - | |
| 1001 | + | |
1001 | 1002 | | |
1002 | | - | |
1003 | | - | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
1004 | 1006 | | |
1005 | 1007 | | |
1006 | 1008 | | |
| |||
0 commit comments