ring_pair
Tiny ring-buffer types specialized for exactly two elements.
Types
RingPair<T>: inline storage with[T; 2]BoxedRingPair<T>: heap storage withBox<[T; 2]>
Both provide O(1) push, push_with, and accessors for older/newer entries.
Example
use ;
let mut inline = new;
inline.push;
assert_eq!;
let mut boxed = new;
boxed.push;
assert_eq!;
Development