You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
8 months ago | |
---|---|---|
.. | ||
benches | 8 months ago | |
patches | 8 months ago | |
scripts | 8 months ago | |
src | 8 months ago | |
tests | 8 months ago | |
.cargo_vcs_info.json | 8 months ago | |
.travis.yml | 8 months ago | |
Android.bp | 8 months ago | |
Cargo.toml | 8 months ago | |
Cargo.toml.orig | 8 months ago | |
LICENSE | 8 months ago | |
LICENSE-APACHE | 8 months ago | |
LICENSE-MIT | 8 months ago | |
METADATA | 8 months ago | |
MODULE_LICENSE_APACHE2 | 8 months ago | |
OWNERS | 8 months ago | |
README.md | 8 months ago | |
TEST_MAPPING | 8 months ago |
README.md
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();