Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

include:
# Test MSRV
- rust: 1.50.0
- rust: 1.87
TARGET: x86_64-unknown-linux-gnu

# Test nightly but don't fail
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ version = "0.3.1"
authors = [
"Mathias Koch <mk@blackbird.online>",
]
edition = "2018"
edition = "2024"
rust-version = "1.87"
description = "A Storage Abstraction Layer for Embedded Systems"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-embedded-community/embedded-storage"
Expand Down
6 changes: 3 additions & 3 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ where
I: Iterator<Item = R>,
{
/// Obtain an [`OverlapIterator`] over a subslice of `memory` that overlaps with the region in `self`
fn overlaps(self, memory: &'a [u8], base_address: u32) -> OverlapIterator<R, I>;
fn overlaps(self, memory: &'a [u8], base_address: u32) -> OverlapIterator<'a, R, I>;
}

impl<'a, R, I> Iterator for OverlapIterator<'a, R, I>
Expand All @@ -32,7 +32,7 @@ where
fn next(&mut self) -> Option<Self::Item> {
let mem_start = self.base_address;
let mem_end = self.base_address + self.memory.len() as u32;
while let Some(region) = self.regions.next() {
for region in self.regions.by_ref() {
if mem_start < region.end() && mem_end >= region.start() {
let addr_start = core::cmp::max(mem_start, region.start());
let addr_end = core::cmp::min(mem_end, region.end());
Expand All @@ -51,7 +51,7 @@ where
R: Region,
I: Iterator<Item = R>,
{
fn overlaps(self, memory: &'a [u8], base_address: u32) -> OverlapIterator<R, I> {
fn overlaps(self, memory: &'a [u8], base_address: u32) -> OverlapIterator<'a, R, I> {
OverlapIterator {
memory,
regions: self,
Expand Down
6 changes: 3 additions & 3 deletions src/nor_flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fn check_slice<T: ReadNorFlash>(
if length > flash.capacity() || offset > flash.capacity() - length {
return Err(NorFlashErrorKind::OutOfBounds);
}
if offset % align != 0 || length % align != 0 {
if !offset.is_multiple_of(align) || !length.is_multiple_of(align) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this new API :)

Copy link
Copy Markdown
Contributor Author

@robamu robamu Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requires rust MSRV 1.87 though. Do you think the MSRV bump is okay for this PR as well?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with it, but I'm not the primary maintainer here. Thoughts @diondokter ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just do it yeah

return Err(NorFlashErrorKind::NotAligned);
}
Ok(())
Expand Down Expand Up @@ -215,7 +215,7 @@ impl Region for Page {
}
}

///
/// Read-Modify-Write (RMW) Nor Flash storage structure.
pub struct RmwNorFlashStorage<'a, S> {
storage: S,
merge_buffer: &'a mut [u8],
Expand Down Expand Up @@ -290,7 +290,7 @@ where
}
}

///
/// Read-Modify-Write (RMW) Multi-Write Nor Flash storage structure.
pub struct RmwMultiwriteNorFlashStorage<'a, S> {
storage: S,
merge_buffer: &'a mut [u8],
Expand Down
Loading