From f7396f7f733d6f73cc4b19b9e19df046e03ef770 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2025 10:25:57 +0100 Subject: [PATCH 1/2] Implement Clone and Copy for InterchangeRef --- CHANGELOG.md | 4 +++- src/lib.rs | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c6aa81..a985747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Changed +### Added + +- Add `Clone` and `Copy` implementations for `InterchangeRef`. ## [0.3.1][] - 2024-06-20 diff --git a/src/lib.rs b/src/lib.rs index 6af9676..3f062ae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -941,6 +941,7 @@ pub struct InterchangeRef<'alloc, Rq, Rp> { channels: &'alloc [Channel], last_claimed: &'alloc AtomicUsize, } + impl<'alloc, Rq, Rp> InterchangeRef<'alloc, Rq, Rp> { /// Claim one of the channels of the interchange. Returns None if called more than `N` times. pub fn claim(&self) -> Option<(Requester<'alloc, Rq, Rp>, Responder<'alloc, Rq, Rp>)> { @@ -964,6 +965,14 @@ impl<'alloc, Rq, Rp> InterchangeRef<'alloc, Rq, Rp> { } } +impl Clone for InterchangeRef<'_, Rq, Rp> { + fn clone(&self) -> Self { + *self + } +} + +impl Copy for InterchangeRef<'_, Rq, Rp> {} + impl Default for Interchange { fn default() -> Self { Self::new() From 4a0eb996710face821ee7c643462c75109fc92db Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 14 Jan 2025 10:27:24 +0100 Subject: [PATCH 2/2] Release v0.3.2 --- CHANGELOG.md | 7 ++++++- Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a985747..1383148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- + +## [0.3.2][] - 2024-01-14 + ### Added - Add `Clone` and `Copy` implementations for `InterchangeRef`. @@ -37,7 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changes API to use references instead of moves. This improves stack usage. -[Unreleased]: https://github.com/trussed-dev/interchange/compare/0.3.1...HEAD +[Unreleased]: https://github.com/trussed-dev/interchange/compare/0.3.2...HEAD +[0.3.2]: https://github.com/trussed-dev/interchange/compare/0.3.1...0.3.2 [0.3.1]: https://github.com/trussed-dev/interchange/compare/0.3.0...0.3.1 [0.3.0]: https://github.com/trussed-dev/interchange/compare/0.2.2...0.3.0 [0.2.2]: https://github.com/trussed-dev/interchange/compare/0.2.0...0.2.2 diff --git a/Cargo.toml b/Cargo.toml index 1f92965..9ffb319 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "interchange" -version = "0.3.1" +version = "0.3.2" authors = ["The Trussed developers", "Nicolas Stalder "] edition = "2018" description = "Request/response mechanism for embedded development, using atomics"