Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
benches/ | 03-May-2024 | - | 297 | 253 | ||
patches/ | 03-May-2024 | - | 14 | 13 | ||
scripts/ | 03-May-2024 | - | 22 | 10 | ||
src/ | 03-May-2024 | - | 2,923 | 2,067 | ||
tests/ | 03-May-2024 | - | 25 | 18 | ||
.cargo_vcs_info.json | D | 03-May-2024 | 74 | 6 | 5 | |
.gitignore | D | 03-May-2024 | 38 | 4 | 3 | |
.travis.yml | D | 03-May-2024 | 947 | 38 | 37 | |
Android.bp | D | 03-May-2024 | 1.7 KiB | 51 | 47 | |
Cargo.toml | D | 03-May-2024 | 1.1 KiB | 38 | 35 | |
Cargo.toml.orig | D | 03-May-2024 | 649 | 26 | 22 | |
LICENSE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
LICENSE-APACHE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | D | 03-May-2024 | 1 KiB | 26 | 22 | |
METADATA | D | 03-May-2024 | 418 | 20 | 19 | |
MODULE_LICENSE_APACHE2 | D | 03-May-2024 | 0 | |||
OWNERS | D | 03-May-2024 | 40 | 2 | 1 | |
README.md | D | 03-May-2024 | 649 | 27 | 18 | |
TEST_MAPPING | D | 03-May-2024 | 147 | 9 | 8 |
README.md
1rust-smallvec 2============= 3 4[Documentation](https://docs.rs/smallvec/) 5 6[Release notes](https://github.com/servo/rust-smallvec/releases) 7 8"Small vector" optimization for Rust: store up to a small number of items on the stack 9 10## Example 11 12```rust 13use smallvec::{SmallVec, smallvec}; 14 15// This SmallVec can hold up to 4 items on the stack: 16let mut v: SmallVec<[i32; 4]> = smallvec![1, 2, 3, 4]; 17 18// It will automatically move its contents to the heap if 19// contains more than four items: 20v.push(5); 21 22// SmallVec points to a slice, so you can use normal slice 23// indexing and other methods to access its contents: 24v[0] = v[1] + v[2]; 25v.sort(); 26``` 27