3 releases (breaking)
Uses old Rust 2015
0.3.0 | Jun 10, 2017 |
---|---|
0.2.1 | Jun 6, 2017 |
0.1.0 | Jun 5, 2017 |
#2333 in Data structures
7KB
176 lines
ALO
Overview
ALO means "At Least One". ALO is simple data structure which contains at least one items. ALO does not heap allocation until there is only one item.
How to use
// Initialize
let mut alo = ALO::with_item(42);
// Adding
alo.add(777);
alo.add(0);
// Removing
assert_eq!(Some(&42), alo.remove(0));
// Getting
assert_eq!(Some(&777), alo.get(0));