- When the buffer is full,
push_front()
andpush_back()
now return the replaced element (contributed by Zacchary Dempsey-Plante).
- Increased the minimum supported rustc version to 1.82
- This release does not introduce any new features or bug fixes. It only changes the dev-dependencies used by unit tests (contributed by Ben Beasley).
- Added optional support for
embedded-io
andembedded-io-async
(contributed by DaneSlattery).
- Renamed the
use_std
cargo feature tostd
(the olduse_std
is now an alias forstd
, so this is not a breaking change).
-
Implemented the traits
Index<usize>
andIndexMut<usize>
forCircularBuffer
. Now elements of the buffer can be accessed and modified with indexing operations (buf[index]
), like in the following example:use circular_buffer::CircularBuffer; let mut buf = CircularBuffer::<5, char>::from(['a', 'b', 'c']); assert_eq!(buf[0], 'a'); buf[1] = 'd'; assert_eq!(buf[1], 'd');
-
Added new methods to fill the whole buffer, or the spare capacity of the buffer:
fill()
,fill_with()
,fill_spare()
,fill_spare_with()
. -
Added a new
alloc
feature that brings heap-allocation features tono_std
environments through thealloc
crate (contributed by Haoud). -
Implemented the
BufRead
trait forCircularBuffer
(not available inno_std
environments).
-
Fixed an out-of-bounds read in
remove()
. -
Removed
#[must_use]
fromdrain()
: it is perfectly acceptable to ignore the return value from this method.
- Raised the minimum rustc version to 1.65
- Fixed a bug in bug in bug in the
PartialEq
implementation that would lead to a panic in some circumstances.
-
Added
try_push_back()
andtry_push_front()
as non-overwriting alternatives topush_back()
andpush_front()
(contributed by Rinat Shigapov in GH-5). -
Added
drain()
to remove ranges of elements. -
Added
make_contiguous()
to return a contiguous mutable slice of elements.
- Fixed a bug in
range()
andrange_mut()
that made them return more elements than requested in some circumstances.
- Fixed
range()
andrange_mut()
when passing an empty range (contributed by Icxolu in GH-4).
-
Made
extend_from_slice()
safer by ensuring that all cloned elements get dropped in case a panic occurs. -
Optimized all
PartialEq
implementations. -
Fixed a strict-provenance error in
swap()
(contributed by René Kijewski in GH-2).
- Made circular-buffer compatible with the stable version of rustc.
- Initial release.