Skip to main content

Crate lessvec

Crate lessvec 

Source
Expand description

A minimal Vec-like collection implemented with manual allocation.

This crate provides LessVec<T>, a small, educational reimplementation of std::vec::Vec<T> following patterns from the Rustonomicon. It’s intended for learning and small use-cases, not as a drop-in replacement for Vec.

§Examples

use lessvec::LessVec;

let mut v = LessVec::new();
v.push(1);
v.push(2);
assert_eq!(&*v, &[1, 2]);
assert_eq!(v.pop(), Some(2));

See individual method docs for more examples.

Modules§

prelude
Re-exports a small “prelude” of the most commonly-used items.

Macros§

lessvec
Create a LessVec with the same syntax as the standard vec! macro.

Structs§

Drain
An iterator produced by LessVec::drain.
IntoIter
Iterator that yields values by value when consuming a LessVec.
LessVec
A minimal growable contiguous vector.