one-stack-vec 0.5.1

OneStackVec could contain any number of item like `Vec`, and it does heap allocation only when it contains more than one item.
Documentation

One-Stack-Vec

Overview

OneStackVec is simple data structure which contains any number of items. It does not heap allocation until there is one or zero item.

How to use

// Initialize
let mut items = OneStackVec::new();

// Adding
items.add(42);

// Getting
assert_eq!(Some(&42), items.get(0));

// Removing
assert_eq!(Some(&42), items.remove(0));
assert_eq!(None, items.get(0));