From 5bfef78959745f89d56e0297082b7ffc05eb63a4 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Mon, 15 Sep 2025 09:33:22 +0200 Subject: [PATCH 1/2] Update to `defmt` 1.0.1, `embedded-hal-bus` 0.3.0, `env_logger` 0.11.8, `heapless` 0.9.1, and `hex-literal` 1.0.0. --- CHANGELOG.md | 5 +++++ Cargo.toml | 12 ++++++------ src/fat/bpb.rs | 2 +- src/fat/info.rs | 2 +- src/fat/ondiskdirentry.rs | 2 +- src/filesystem/directory.rs | 6 +++--- src/filesystem/files.rs | 2 +- src/lib.rs | 4 ++-- src/volume_mgr.rs | 2 +- 9 files changed, 21 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ff7a2f5..ba8485a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic ## [Unreleased] +### Changed + +- Updated to `defmt` 1.0.1, `embedded-hal-bus` 0.3.0, `env_logger` 0.11.8, `heapless` 0.9.1, and `hex-literal` 1.0.0. +- Raised the minimum supported Rust version to 1.86.0. + ## [Version 0.9.0] - 2025-06-08 ### Changed diff --git a/Cargo.toml b/Cargo.toml index 11b6ff6a..322027a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,22 +11,22 @@ repository = "https://github.com/rust-embedded-community/embedded-sdmmc-rs" version = "0.9.0" # Make sure to update the CI too! -rust-version = "1.76" +rust-version = "1.86" [dependencies] byteorder = {version = "1", default-features = false} -defmt = {version = "0.3", optional = true} +defmt = {version = "1.0.1", optional = true} embedded-hal = "1.0.0" embedded-io = "0.6.1" -heapless = "^0.8" +heapless = "0.9.1" log = {version = "0.4", default-features = false, optional = true} [dev-dependencies] chrono = "0.4" -embedded-hal-bus = "0.2.0" -env_logger = "0.10.0" +embedded-hal-bus = "0.3.0" +env_logger = "0.11.8" flate2 = "1.0" -hex-literal = "0.4.1" +hex-literal = "1.0.0" sha2 = "0.10" [features] diff --git a/src/fat/bpb.rs b/src/fat/bpb.rs index c7e83b62..b61bf651 100644 --- a/src/fat/bpb.rs +++ b/src/fat/bpb.rs @@ -20,7 +20,7 @@ impl<'a> Bpb<'a> { pub(crate) const FOOTER_VALUE: u16 = 0xAA55; /// Attempt to parse a Boot Parameter Block from a 512 byte sector. - pub fn create_from_bytes(data: &[u8; 512]) -> Result { + pub fn create_from_bytes(data: &[u8; 512]) -> Result, &'static str> { let mut bpb = Bpb { data, fat_type: FatType::Fat16, diff --git a/src/fat/info.rs b/src/fat/info.rs index f9f8e2c3..9bed9329 100644 --- a/src/fat/info.rs +++ b/src/fat/info.rs @@ -49,7 +49,7 @@ impl<'a> InfoSector<'a> { const TRAIL_SIG: u32 = 0xAA55_0000; /// Try and create a new Info Sector from a block. - pub fn create_from_bytes(data: &[u8; 512]) -> Result { + pub fn create_from_bytes(data: &[u8; 512]) -> Result, &'static str> { let info = InfoSector { data }; if info.lead_sig() != Self::LEAD_SIG { return Err("Bad lead signature on InfoSector"); diff --git a/src/fat/ondiskdirentry.rs b/src/fat/ondiskdirentry.rs index 83707e47..f4c753ea 100644 --- a/src/fat/ondiskdirentry.rs +++ b/src/fat/ondiskdirentry.rs @@ -57,7 +57,7 @@ impl<'a> OnDiskDirEntry<'a> { /// Create a new on-disk directory entry from a block of 32 bytes read /// from a directory file. - pub fn new(data: &[u8]) -> OnDiskDirEntry { + pub fn new(data: &[u8]) -> OnDiskDirEntry<'_> { OnDiskDirEntry { data } } diff --git a/src/filesystem/directory.rs b/src/filesystem/directory.rs index 527807bc..ccb6d508 100644 --- a/src/filesystem/directory.rs +++ b/src/filesystem/directory.rs @@ -58,7 +58,7 @@ impl RawDirectory { >( self, volume_mgr: &VolumeManager, - ) -> Directory + ) -> Directory<'_, D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES> where D: crate::BlockDevice, T: crate::TimeSource, @@ -113,7 +113,7 @@ where pub fn open_dir( &self, name: N, - ) -> Result, Error> + ) -> Result, Error> where N: ToShortFileName, { @@ -193,7 +193,7 @@ where &self, name: N, mode: crate::Mode, - ) -> Result, crate::Error> + ) -> Result, crate::Error> where N: super::ToShortFileName, { diff --git a/src/filesystem/files.rs b/src/filesystem/files.rs index eaa5462a..15673c7e 100644 --- a/src/filesystem/files.rs +++ b/src/filesystem/files.rs @@ -30,7 +30,7 @@ impl RawFile { pub fn to_file( self, volume_mgr: &VolumeManager, - ) -> File + ) -> File<'_, D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES> where D: crate::BlockDevice, T: crate::TimeSource, diff --git a/src/lib.rs b/src/lib.rs index c6af4e95..2a5269b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -297,7 +297,7 @@ impl RawVolume { >( self, volume_mgr: &VolumeManager, - ) -> Volume + ) -> Volume<'_, D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES> where D: crate::BlockDevice, T: crate::TimeSource, @@ -346,7 +346,7 @@ where /// use `open_file_in_dir`. pub fn open_root_dir( &self, - ) -> Result, Error> { + ) -> Result, Error> { let d = self.volume_mgr.open_root_dir(self.raw_volume)?; Ok(d.to_directory(self.volume_mgr)) } diff --git a/src/volume_mgr.rs b/src/volume_mgr.rs index 69573d1a..9dcb7ede 100644 --- a/src/volume_mgr.rs +++ b/src/volume_mgr.rs @@ -110,7 +110,7 @@ where pub fn open_volume( &self, volume_idx: VolumeIdx, - ) -> Result, Error> { + ) -> Result, Error> { let v = self.open_raw_volume(volume_idx)?; Ok(v.to_volume(self)) } From fbc8a25cd29d6db21c86241e939d27dd0cb5c111 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Mon, 15 Sep 2025 09:36:15 +0200 Subject: [PATCH 2/2] Raise Rust version in CI --- .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 45b6e5d3..129ffd3d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: # Always run MSRV too! - rust: ["stable", "1.76"] + rust: ["stable", "1.86"] features: ['log', 'defmt-log', '""'] steps: - uses: actions/checkout@v4