From 82d80d7666d161bcf11b66ed4c211843efb8f96a Mon Sep 17 00:00:00 2001 From: Dion Dokter Date: Tue, 24 Mar 2026 14:32:30 +0100 Subject: [PATCH] Release v7.2.0 --- .github/workflows/ci.yaml | 4 ++-- CHANGELOG.md | 4 ++++ Cargo.toml | 5 +++-- src/queue/{buffer.rs => buffered.rs} | 3 ++- src/queue/mod.rs | 5 +---- 5 files changed, 12 insertions(+), 9 deletions(-) rename src/queue/{buffer.rs => buffered.rs} (99%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1207018..722e45b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,14 +20,14 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - - run: cargo test --features arrayvec,heapless,heapless-09,alloc + - run: cargo test --features arrayvec,heapless,heapless-09,alloc,postcard,shared-ram-ring clippy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - - run: cargo clippy --features arrayvec,heapless,heapless-09,alloc -- -D warnings + - run: cargo clippy --features arrayvec,heapless,heapless-09,alloc,postcard,shared-ram-ring -- -D warnings fuzz: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 09cb495..ace197d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## Unreleased +## 7.2.0 - 24-03-26 + +- Added a RAM-buffered queue + ## 7.1.0 - 19-01-26 - Added `postcard` feature, disabled by default. This enables the `PostcardValue` trait. diff --git a/Cargo.toml b/Cargo.toml index e513a47..c36d09e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sequential-storage" -version = "7.1.0" +version = "7.2.0" edition = "2024" license = "MIT OR Apache-2.0" description = "A crate for storing data in flash with minimal erase cycles." @@ -22,9 +22,10 @@ heapless = { version = "0.8.0", optional = true } heapless-09 = { package = "heapless", version = "0.9.0", optional = true } postcard = { version = "1.1.3", optional = true } serde = { version = "1.0.228", default-features = false, optional = true } -embassy-sync = { version = "0.6", optional = true } +embassy-sync = { version = "0.8.0", optional = true } [dev-dependencies] +critical-section = { version = "1", features = ["std"]} approx = "0.5.1" futures = { version = "0.3.30", features = ["executor"] } futures-test = "0.3.30" diff --git a/src/queue/buffer.rs b/src/queue/buffered.rs similarity index 99% rename from src/queue/buffer.rs rename to src/queue/buffered.rs index 3a8a8ee..b59b681 100644 --- a/src/queue/buffer.rs +++ b/src/queue/buffered.rs @@ -40,7 +40,7 @@ use crate::{Error, cache::CacheImpl}; /// /// Each item is stored as a 2-byte little-endian length prefix followed by the item's bytes, /// so the usable capacity for data is `N - 2` bytes per item at most. -pub struct RamRing { +struct RamRing { buf: [u8; N], read_pos: usize, write_pos: usize, @@ -67,6 +67,7 @@ impl RamRing { } /// Returns `true` if the ring contains no items. + #[allow(unused)] pub fn is_empty(&self) -> bool { self.item_count == 0 } diff --git a/src/queue/mod.rs b/src/queue/mod.rs index 3784ae1..8cd46bd 100644 --- a/src/queue/mod.rs +++ b/src/queue/mod.rs @@ -1,9 +1,6 @@ //! Implementation of the queue logic. -pub mod buffer; -#[cfg(feature = "shared-ram-ring")] -pub use buffer::SharedRamRing; -pub use buffer::{BufferedQueue, OverflowPolicy, RamRing}; +pub mod buffered; use crate::item::{Item, ItemHeader, ItemHeaderIter};