Skip to content

Commit

Permalink
digital_io: add clippy exception for the #[cfg(test)] variant of mod …
Browse files Browse the repository at this point in the history
…gpio

Clippy disallows #[cfg(test)] mods that are followed by other code by
default[1] and usually this makes sense, because tests should be at the
end of the file, but in our case the mod does not contain tests but instead
imports a test-specific variant of the gpio mod.

Allow that.

[1]: https://rust-lang.github.io/rust-clippy/master/index.html#/items_after_test_module

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
  • Loading branch information
hnez committed Jan 11, 2024
1 parent e7b35a0 commit e926b6d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/digital_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use async_std::task::spawn;
use crate::broker::{BrokerBuilder, Topic};
use crate::led::BlinkPattern;

#[allow(clippy::items_after_test_module)]
#[cfg(test)]
mod gpio {
mod test;
Expand Down

0 comments on commit e926b6d

Please sign in to comment.