smallvec (1.15.1)
Published 2026-03-26 11:03:47 +00:00 by siennathesane
Installation
[registry]
default = "gitea"
[registries.gitea]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add smallvec@1.15.1About this package
'Small vector' optimization: store up to a small number of items on the stack
rust-smallvec
"Small vector" optimization for Rust: store up to a small number of items on the stack
Example
use smallvec::{SmallVec, smallvec};
// This SmallVec can hold up to 4 items on the stack:
let mut v: SmallVec<[i32; 4]> = smallvec![1, 2, 3, 4];
// It will automatically move its contents to the heap if
// contains more than four items:
v.push(5);
// SmallVec points to a slice, so you can use normal slice
// indexing and other methods to access its contents:
v[0] = v[1] + v[2];
v.sort();
Dependencies
| ID | Version |
|---|---|
| arbitrary | ^1 |
| bincode | ^2 |
| malloc_size_of | ^0.1 |
| serde | ^1 |
| unty | ^0.0.4 |
| bincode1 | ^1.0.1 |
| debugger_test | ^0.1.0 |
| debugger_test_parser | ^0.1.0 |
Keywords
small
vec
vector
stack
no_std
Details
2026-03-26 11:03:47 +00:00
Assets (1)
Versions (1)
View all
Cargo
0
The Servo Project Developers
MIT OR Apache-2.0
36 KiB
smallvec-1.15.1.crate
36 KiB
1.15.1
2026-03-26