Commit 59e8043
committed
tacd: replace instances of x % N == 0 with x.is_multiple_of(N)
This is inspired by a recently added clippy lint:
error: manual implementation of `.is_multiple_of()`
--> src/dut_power.rs:248:16
|
248 | if N % 2 == 0 {
| ^^^^^^^^^^ help: replace with: `N.is_multiple_of(2)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of
= note: `-D clippy::manual-is-multiple-of` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::manual_is_multiple_of)]`
error: manual implementation of `.is_multiple_of()`
--> src/ui/screens/diagnostics.rs:256:26
|
256 | let on = self.led_cycle_state % 2 != 0;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!self.led_cycle_state.is_multiple_of(2)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of
Signed-off-by: Leonard Göhrs <[email protected]>1 parent 71aae7a commit 59e8043
3 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
0 commit comments