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.
|
|
2 years ago | |
|---|---|---|
| .. | ||
| .github/workflows | 2 years ago | |
| benches | 2 years ago | |
| debug_metadata | 2 years ago | |
| scripts | 2 years ago | |
| src | 2 years ago | |
| tests | 2 years ago | |
| .cargo_vcs_info.json | 2 years ago | |
| .gitignore | 2 years ago | |
| Android.bp | 2 years ago | |
| Cargo.toml | 2 years ago | |
| Cargo.toml.orig | 2 years ago | |
| LICENSE | 2 years ago | |
| LICENSE-APACHE | 2 years ago | |
| LICENSE-MIT | 2 years ago | |
| METADATA | 2 years ago | |
| MODULE_LICENSE_APACHE2 | 2 years ago | |
| OWNERS | 2 years ago | |
| README.md | 2 years ago | |
| TEST_MAPPING | 2 years ago | |
| cargo2android.json | 2 years 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();