vecless
vecless is a minimal, ergonomic, singly linked list implementation in Rust — no Vec required.
✨ Features
- ✅ No
Vecor heap-allocated arrays - ✅ Supports
.add(...)with any iterable - ✅ Implements
Displayfor clean, human-readable output - ✅ Iterator support for
forloops and.iter()
🚀 Example
use List;
Why Vecless?
Rust’s built-in Vec<T> is powerful and flexible — but it doesn’t implement the Display trait, which means you can’t print it with {}. Instead, you have to use the debug formatter {:?}:
let v = vec!;
println!; // [1, 2, 3]
vecless was created to:
- Provide a list type that implements
Displayout of the box - Offer a lightweight, composable alternative to
Vecfor learning and experimentation - Help developers understand how linked lists work under the hood in Rust
- Serve as a teaching tool or a minimal data structure for constrained environments
While not a replacement for Vec in performance-critical code, vecless is great for:
- Educational projects
- Functional-style list building
- CLI tools or embedded contexts where simplicity matters
Want to contribute or suggest improvements? Open an issue or start a discussion!