Skip to content

Conversation

hnez
Copy link
Member

@hnez hnez commented Sep 19, 2025

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

This should fix the currently broken scheduled builds.

@hnez
Copy link
Member Author

hnez commented Sep 19, 2025

We have to postpone this until our rustc version is updated, since .is_multiple_of() was not yet stabilized in the rustc version in Yocto walnascar (1.87.0 vs 1.84.1).

See #102 for a a PR that just disables the lint for now.

@hnez hnez marked this pull request as draft September 19, 2025 05:23
Copy link
Member

@SmithChart SmithChart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's wait for a compatible rustc in yocto and then we are good to go.

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants