Releases: andreacorbellini/rust-circular-buffer
v1.0.0
New features
- When the buffer is full,
push_front()
andpush_back()
now return the replaced element (contributed by Zacchary Dempsey-Plante).
Other changes
- Increased the minimum supported rustc version to 1.82
v0.1.9
- 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).
v0.1.8
New features
- Added optional support for
embedded-io
andembedded-io-async
(contribyted by DaneSlattery).
Other changes
- Renamed the
use_std
cargo feature tostd
(the olduse_std
is now an alias forstd
, so this is not a breaking change).
v0.1.7
New features
-
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).
Bug fixes
- Fixed an out-of-bounds read in
remove()
. - Removed
#[must_use]
fromdrain()
: it is perfectly acceptable to ignore the return value from this method.
Other changes
- Raised the minimum rustc version to 1.65
Crate: https://crates.io/crates/circular-buffer/0.1.7
Documentation: https://docs.rs/circular-buffer/0.1.7/circular_buffer/index.html
v0.1.6
- Fixed a bug in bug in bug in the
PartialEq
implementation that would lead to a panic in some circumstances.
Crate: https://crates.io/crates/circular-buffer/0.1.6
Documentation: https://docs.rs/circular-buffer/0.1.6/circular_buffer/index.html
v0.1.5
- 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. Iter
andIterMut
now implement theDefault
trait.
Crate: https://crates.io/crates/circular-buffer/0.1.5
Documentation: https://docs.rs/circular-buffer/0.1.5/circular_buffer/index.html
v0.1.4
- Fixed a bug in
range()
andrange_mut()
that made them return more elements than requested in some circumstances.
Crate: https://crates.io/crates/circular-buffer/0.1.4
Documentation: https://docs.rs/circular-buffer/0.1.4/circular_buffer/index.html
v0.1.3
- Fixed
range()
andrange_mut()
when passing an empty range (contributed by Icxolu in GH-4).
Crate: https://crates.io/crates/circular-buffer/0.1.3
Documentation: https://docs.rs/circular-buffer/0.1.3/circular_buffer/index.html
v0.1.2
- 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).
Crate: https://crates.io/crates/circular-buffer/0.1.2
Documentation: https://docs.rs/circular-buffer/0.1.2/circular_buffer/index.html
v0.1.1
- Made
circular-buffer
compatible with the stable version of rustc.
Crate: https://crates.io/crates/circular-buffer/0.1.1
Documentation: https://docs.rs/circular-buffer/0.1.1/circular_buffer/index.html