From aa9aa09bcde481c3fee294fc568c361aec76e980 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 14 Oct 2024 20:56:00 +0200 Subject: [PATCH] Fix formatting --- components/boards/src/flash.rs | 4 +--- .../src/nk3am/migrations/ftl_journal/ifs_flash_old.rs | 3 +-- components/boards/src/soc/nrf52/flash.rs | 3 +-- components/lfs-backup/src/lfs_backup.rs | 5 ++++- components/provisioner-app/src/lib.rs | 10 +++++----- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/components/boards/src/flash.rs b/components/boards/src/flash.rs index 5c62f61c..bd26f9fd 100644 --- a/components/boards/src/flash.rs +++ b/components/boards/src/flash.rs @@ -62,9 +62,7 @@ where for chunk in data.chunks(CHUNK_SIZE) { let buf = &mut buf[..chunk.len()]; buf.copy_from_slice(chunk); - flash - .write_bytes(off, buf) - .map_err(|_| Error::IO)?; + flash.write_bytes(off, buf).map_err(|_| Error::IO)?; off += CHUNK_SIZE as u32; } Ok(data.len()) diff --git a/components/boards/src/nk3am/migrations/ftl_journal/ifs_flash_old.rs b/components/boards/src/nk3am/migrations/ftl_journal/ifs_flash_old.rs index 683953bf..b57b3ec3 100644 --- a/components/boards/src/nk3am/migrations/ftl_journal/ifs_flash_old.rs +++ b/components/boards/src/nk3am/migrations/ftl_journal/ifs_flash_old.rs @@ -78,8 +78,7 @@ fn nvmc_to_lfs_return( r: Result<(), nrf52840_hal::nvmc::NvmcError>, len: usize, ) -> Result { - r.map(|_| len) - .map_err(|_| littlefs2::io::Error::IO) // 'NVMC' + r.map(|_| len).map_err(|_| littlefs2::io::Error::IO) // 'NVMC' } impl FlashStorage { diff --git a/components/boards/src/soc/nrf52/flash.rs b/components/boards/src/soc/nrf52/flash.rs index 8db127c4..18b3b2bf 100644 --- a/components/boards/src/soc/nrf52/flash.rs +++ b/components/boards/src/soc/nrf52/flash.rs @@ -269,8 +269,7 @@ fn nvmc_to_lfs_return( r: Result<(), nrf52840_hal::nvmc::NvmcError>, len: usize, ) -> Result { - r.map(|_| len) - .map_err(|_| littlefs2::io::Error::IO) // 'NVMC' + r.map(|_| len).map_err(|_| littlefs2::io::Error::IO) // 'NVMC' } impl FlashStorage { diff --git a/components/lfs-backup/src/lfs_backup.rs b/components/lfs-backup/src/lfs_backup.rs index 64610513..a0f73330 100644 --- a/components/lfs-backup/src/lfs_backup.rs +++ b/components/lfs-backup/src/lfs_backup.rs @@ -1,7 +1,10 @@ use littlefs2::consts::PATH_MAX; use littlefs2::fs::{DirEntry, Filesystem}; -use littlefs2::{path, path::{Path, PathBuf}}; +use littlefs2::{ + path, + path::{Path, PathBuf}, +}; use serde::{Deserialize, Serialize}; diff --git a/components/provisioner-app/src/lib.rs b/components/provisioner-app/src/lib.rs index 9405296c..7856d3c7 100644 --- a/components/provisioner-app/src/lib.rs +++ b/components/provisioner-app/src/lib.rs @@ -19,7 +19,10 @@ generate_macros!(); use core::convert::TryFrom; use heapless::Vec; -use littlefs2::{path, path::{Path, PathBuf}}; +use littlefs2::{ + path, + path::{Path, PathBuf}, +}; use trussed::{ client, key::{Flags, Key, Kind as KeyKind}, @@ -245,10 +248,7 @@ where &serialized_bytes, ) .map_err(|_| Error::NotEnoughMemory)?; - info!( - "stored to {}", - FILENAME_P256_SECRET.as_str() - ); + info!("stored to {}", FILENAME_P256_SECRET.as_str()); reply .extend_from_slice(&keypair.public.to_untagged_bytes())