From a14e3f4005e296255a7964eb7f14e6cadbb7b213 Mon Sep 17 00:00:00 2001 From: Albin Hedman Date: Sat, 14 Dec 2024 17:53:21 +0100 Subject: [PATCH] allow static_mut_refs - fmt --- examples/dma.rs | 4 +++- examples/i2c4_bdma.rs | 4 +++- examples/mdma.rs | 4 +++- examples/mdma_bursts.rs | 4 +++- examples/serial-dma.rs | 4 +++- examples/spi-dma-rtic.rs | 4 +++- examples/spi-dma.rs | 4 +++- 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/examples/dma.rs b/examples/dma.rs index 38f43e48..66bf8e6c 100644 --- a/examples/dma.rs +++ b/examples/dma.rs @@ -67,7 +67,9 @@ fn main() -> ! { } } #[allow(static_mut_refs)] // TODO: Fix this - unsafe { SOURCE_BUFFER.assume_init_mut() } + unsafe { + SOURCE_BUFFER.assume_init_mut() + } }; // Save a copy on the stack so we can check it later let source_buffer_cloned = *source_buffer; diff --git a/examples/i2c4_bdma.rs b/examples/i2c4_bdma.rs index 9bc350f8..50e596ec 100644 --- a/examples/i2c4_bdma.rs +++ b/examples/i2c4_bdma.rs @@ -105,7 +105,9 @@ fn main() -> ! { streams.0, i2c, #[allow(static_mut_refs)] // TODO: Fix this - unsafe { BUFFER.assume_init_mut() }, + unsafe { + BUFFER.assume_init_mut() + }, None, config, ); diff --git a/examples/mdma.rs b/examples/mdma.rs index 66421179..348d780f 100644 --- a/examples/mdma.rs +++ b/examples/mdma.rs @@ -62,7 +62,9 @@ fn main() -> ! { } } #[allow(static_mut_refs)] // TODO: Fix this - unsafe { SOURCE_BUFFER.assume_init_mut() } + unsafe { + SOURCE_BUFFER.assume_init_mut() + } }; // diff --git a/examples/mdma_bursts.rs b/examples/mdma_bursts.rs index 6c3b2561..2b6c3641 100644 --- a/examples/mdma_bursts.rs +++ b/examples/mdma_bursts.rs @@ -74,7 +74,9 @@ fn main() -> ! { } } #[allow(static_mut_refs)] // TODO: Fix this - unsafe { SOURCE_BUFFER.assume_init_mut() } + unsafe { + SOURCE_BUFFER.assume_init_mut() + } }; // NOTE(unsafe): TARGET_BUFFER must also be initialised to prevent undefined diff --git a/examples/serial-dma.rs b/examples/serial-dma.rs index 15802ba6..1621fe0d 100644 --- a/examples/serial-dma.rs +++ b/examples/serial-dma.rs @@ -90,7 +90,9 @@ fn main() -> ! { } } #[allow(static_mut_refs)] // TODO: Fix this - unsafe { SHORT_BUFFER.assume_init_mut() } + unsafe { + SHORT_BUFFER.assume_init_mut() + } }; // view u32 buffer as u8. Endianess is undefined (little-endian on STM32H7) let long_buffer: &'static mut [u8; 0x2_0010] = { diff --git a/examples/spi-dma-rtic.rs b/examples/spi-dma-rtic.rs index 2ad1b3ee..47f243e6 100644 --- a/examples/spi-dma-rtic.rs +++ b/examples/spi-dma-rtic.rs @@ -108,7 +108,9 @@ mod app { } #[allow(static_mut_refs)] // TODO: Fix this - unsafe { BUFFER.assume_init_mut() } + unsafe { + BUFFER.assume_init_mut() + } }; let streams = hal::dma::dma::StreamsTuple::new( diff --git a/examples/spi-dma.rs b/examples/spi-dma.rs index ca059818..40f17dea 100644 --- a/examples/spi-dma.rs +++ b/examples/spi-dma.rs @@ -92,7 +92,9 @@ fn main() -> ! { } } #[allow(static_mut_refs)] // TODO: Fix this - unsafe { SHORT_BUFFER.assume_init_mut() } + unsafe { + SHORT_BUFFER.assume_init_mut() + } }; // view u32 buffer as u8. Endianess is undefined (little-endian on STM32H7) let long_buffer: &'static mut [u8; 0x2_0010] = {