From 87f27d5ed6dccb1deda611fb2224768cefed0ef7 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 4 Aug 2021 15:22:26 +0200 Subject: [PATCH 1/2] ci: rustfmt check all .rs files The old script was missing many .rs files that were not enabled due to cfg's. --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 118143da..d11bc8d4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -122,7 +122,7 @@ jobs: with: toolchain: stable - name: Check fmt - run: for i in embassy-*; do (cd $i; cargo fmt -- --check); done + run: find -name '*.rs' | xargs rustfmt --check --skip-children --unstable-features --edition 2018 test: runs-on: ubuntu-latest From a1a5acb82545d1834a769620a0cd69c1e340ff60 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 4 Aug 2021 15:25:21 +0200 Subject: [PATCH 2/2] rustfmt everything --- examples/nrf/src/bin/mpsc.rs | 1 - examples/stm32l0/src/bin/spi.rs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/nrf/src/bin/mpsc.rs b/examples/nrf/src/bin/mpsc.rs index 44395523..cdc7d082 100644 --- a/examples/nrf/src/bin/mpsc.rs +++ b/examples/nrf/src/bin/mpsc.rs @@ -37,7 +37,6 @@ async fn my_task(sender: Sender<'static, WithNoThreads, LedState, 1>) { #[embassy::main] async fn main(spawner: Spawner, p: Peripherals) { - let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); let channel = CHANNEL.put(Channel::new()); diff --git a/examples/stm32l0/src/bin/spi.rs b/examples/stm32l0/src/bin/spi.rs index 5290906e..6a43a965 100644 --- a/examples/stm32l0/src/bin/spi.rs +++ b/examples/stm32l0/src/bin/spi.rs @@ -14,11 +14,11 @@ use embedded_hal::digital::v2::OutputPin; use example_common::*; use cortex_m_rt::entry; +use embassy_stm32::dma::NoDma; use embassy_stm32::rcc; use embassy_stm32::spi::{Config, Spi}; use embassy_stm32::time::Hertz; use embedded_hal::blocking::spi::Transfer; -use embassy_stm32::dma::NoDma; #[entry] fn main() -> ! {