From bbff98ed0de2f37cc25f00b944bb0afb1bb85646 Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Tue, 26 Oct 2021 14:34:03 -0400 Subject: [PATCH] Move the `use` inside the macro call, inside another set of braces in case it percolates up twice. --- embassy-stm32/src/dma/dmamux.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/embassy-stm32/src/dma/dmamux.rs b/embassy-stm32/src/dma/dmamux.rs index 4ce65eb21..14218d56a 100644 --- a/embassy-stm32/src/dma/dmamux.rs +++ b/embassy-stm32/src/dma/dmamux.rs @@ -47,16 +47,17 @@ pac::dma_channels! { }; } -use crate::rcc::sealed::RccPeripheral; - /// safety: must be called only once pub(crate) unsafe fn init() { pac::peripherals! { (dmamux, $peri:ident) => { - pac::peripheral_rcc! { - ($peri, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => { - crate::peripherals::$peri::enable() - }; + { + pac::peripheral_rcc! { + ($peri, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => { + use crate::rcc::sealed::RccPeripheral; + crate::peripherals::$peri::enable() + }; + } } }; }