alo

Crates.ioalo
lib.rsalo
version0.3.0
sourcesrc
created_at2017-06-05 06:43:16.375014
updated_at2017-06-10 06:47:18.476543
descriptionALO means At Least One. It could contain any number of item like `Vec` but it does not heap allocation if it contains only one item.
homepagehttps://github.com/AtsukiTak/alo
repositoryhttps://github.com/AtsukiTak/alo
max_upload_size
id17795
size6,225
Atsuki Takahashi (AtsukiTak)

documentation

README

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));
Commit count: 0

cargo fmt