Skip to content

Commit

Permalink
riot-rs-rt: silence "dead_code" lints when building dummy
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Mar 26, 2024
1 parent 1be15a4 commit 9a241b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/riot-rs-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ cfg_if::cfg_if! {
} else {
// Provide a default architecture, for arch-independent tooling
mod arch {
#[cfg_attr(not(context = "riot-rs"), allow(dead_code))]
pub fn init() {}
pub fn benchmark<F: Fn()>(_iterations: usize, _f: F) -> core::result::Result<usize, ()> {

Check warning on line 40 in src/riot-rs-rt/src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

this returns a `Result<_, ()>`

warning: this returns a `Result<_, ()>` --> src/riot-rs-rt/src/lib.rs:40:13 | 40 | pub fn benchmark<F: Fn()>(_iterations: usize, _f: F) -> core::result::Result<usize, ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use a custom `Error` type instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err = note: `#[warn(clippy::result_unit_err)]` on by default

Check warning on line 40 in src/riot-rs-rt/src/lib.rs

View workflow job for this annotation

GitHub Actions / lint

this returns a `Result<_, ()>`

warning: this returns a `Result<_, ()>` --> src/riot-rs-rt/src/lib.rs:40:13 | 40 | pub fn benchmark<F: Fn()>(_iterations: usize, _f: F) -> core::result::Result<usize, ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use a custom `Error` type instead = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err = note: `#[warn(clippy::result_unit_err)]` on by default
unimplemented!();
Expand Down Expand Up @@ -70,6 +71,7 @@ use linkme::distributed_slice;
pub static INIT_FUNCS: [fn()] = [..];

#[inline]
#[cfg_attr(not(context = "riot-rs"), allow(dead_code))]
fn startup() -> ! {
arch::init();

Expand Down

0 comments on commit 9a241b9

Please sign in to comment.