Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riot-rs-rt: silence "dead_code" lints when building dummy #216

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,8 +35,9 @@
} 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
unimplemented!();
}
}
Expand Down Expand Up @@ -70,6 +71,7 @@
pub static INIT_FUNCS: [fn()] = [..];

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

Expand Down
Loading