Crates.io | singlevec |
lib.rs | singlevec |
version | |
source | src |
created_at | 2024-06-03 15:27:23.921209+00 |
updated_at | 2025-03-07 16:24:31.930343+00 |
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 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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.