From 54c0da3384150a742a4987f7f883ad62253eeca8 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 22 Feb 2024 21:36:47 +0100 Subject: [PATCH] riot-rs-embassy: fix some dummy arch lints --- src/riot-rs-embassy/src/arch/dummy.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/riot-rs-embassy/src/arch/dummy.rs b/src/riot-rs-embassy/src/arch/dummy.rs index 3facae027..f54ba82e2 100644 --- a/src/riot-rs-embassy/src/arch/dummy.rs +++ b/src/riot-rs-embassy/src/arch/dummy.rs @@ -3,8 +3,18 @@ /// Dummy type. /// /// See the `OptionalPeripherals` type of your Embassy architecture crate instead. +#[derive(Default)] pub struct OptionalPeripherals; +/// Dummy type. +pub struct Peripherals; + +impl From for OptionalPeripherals { + fn from(_peripherals: Peripherals) -> Self { + Self {} + } +} + mod executor { use embassy_executor::SpawnToken; @@ -25,15 +35,16 @@ mod executor { pub struct Spawner {} impl Spawner { - pub fn spawn(&self, token: SpawnToken) -> Result<(), ()> { + #[allow(clippy::result_unit_err)] + pub fn spawn(&self, _token: SpawnToken) -> Result<(), ()> { Ok(()) } } } pub use executor::{Executor, Spawner}; -pub fn init(_: ()) -> OptionalPeripherals { - OptionalPeripherals {} +pub fn init(_: OptionalPeripherals) -> Peripherals { + Peripherals {} } pub struct SWI;