Crates.io | singlevec |
lib.rs | singlevec |
version | 1.6.0 |
source | src |
created_at | 2024-06-03 15:27:23.921209 |
updated_at | 2024-10-21 17:03:06.343798 |
description | Vec-like container optimized for storing only a single item |
homepage | https://github.com/tuffy/singlevec |
repository | https://github.com/tuffy/singlevec |
max_upload_size | |
id | 1260214 |
size | 34,062 |
For when you need a Vec
, but intend to store only one item
most of the time. In that case, that single item can be stored
on the stack and will fall back to heap storage for multiple items.
Like a tinyvec::TinyVec<[T; 1]>
that shares methods
in common with both Vec
and Option
.
Simple and 100% safe code for a simple use case.