From 6df737a48c35c582ed31387ddf7ebedb86a814b5 Mon Sep 17 00:00:00 2001 From: Ragarnoy Date: Tue, 30 Apr 2024 02:11:38 +0200 Subject: [PATCH] rustfmt --- .../src/shared_bus/blocking/spi.rs | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs index b01012695..e7e112b0a 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs @@ -37,8 +37,11 @@ pub struct SpiDevice<'a, M: RawMutex, BUS, CS, Word> { impl<'a, M: RawMutex, BUS, CS, Word> SpiDevice<'a, M, BUS, CS, Word> { /// Create a new `SpiDevice`. pub fn new(bus: &'a Mutex>, cs: CS) -> Self { - Self { bus, cs - , _word: core::marker::PhantomData} + Self { + bus, + cs, + _word: core::marker::PhantomData, + } } } @@ -93,7 +96,8 @@ where } } -impl<'d, M, BUS, CS, BusErr, CsErr, Word> embedded_hal_02::blocking::spi::Transfer for SpiDevice<'_, M, BUS, CS, Word> +impl<'d, M, BUS, CS, BusErr, CsErr, Word> embedded_hal_02::blocking::spi::Transfer + for SpiDevice<'_, M, BUS, CS, Word> where M: RawMutex, BUS: embedded_hal_02::blocking::spi::Transfer, @@ -134,11 +138,12 @@ where } } -impl<'d, M, BUS, CS, BusErr, CsErr, Word> embedded_hal_02::blocking::spi::Transfer for SpiDevice<'_, M, BUS, CS, Word> - where - M: RawMutex, - BUS: embedded_hal_02::blocking::spi::Transfer, - CS: OutputPin, +impl<'d, M, BUS, CS, BusErr, CsErr, Word> embedded_hal_02::blocking::spi::Transfer + for SpiDevice<'_, M, BUS, CS, Word> +where + M: RawMutex, + BUS: embedded_hal_02::blocking::spi::Transfer, + CS: OutputPin, { type Error = SpiDeviceError; fn transfer<'w>(&mut self, words: &'w mut [u16]) -> Result<&'w [u16], Self::Error> { @@ -155,10 +160,10 @@ impl<'d, M, BUS, CS, BusErr, CsErr, Word> embedded_hal_02::blocking::spi::Transf } impl<'d, M, BUS, CS, BusErr, CsErr, Word> embedded_hal_02::blocking::spi::Write for SpiDevice<'_, M, BUS, CS, Word> - where - M: RawMutex, - BUS: embedded_hal_02::blocking::spi::Write, - CS: OutputPin, +where + M: RawMutex, + BUS: embedded_hal_02::blocking::spi::Write, + CS: OutputPin, { type Error = SpiDeviceError; @@ -190,7 +195,12 @@ pub struct SpiDeviceWithConfig<'a, M: RawMutex, BUS: SetConfig, CS, Word> { impl<'a, M: RawMutex, BUS: SetConfig, CS, Word> SpiDeviceWithConfig<'a, M, BUS, CS, Word> { /// Create a new `SpiDeviceWithConfig`. pub fn new(bus: &'a Mutex>, cs: CS, config: BUS::Config) -> Self { - Self { bus, cs, config, _word: core::marker::PhantomData } + Self { + bus, + cs, + config, + _word: core::marker::PhantomData, + } } /// Change the device's config at runtime