commit | 0e60726f906377259a8c88f69291b7bbbe00d45d | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <[email protected]> | Mon Oct 12 00:51:08 2020 -0700 |
committer | Chih-Hung Hsieh <[email protected]> | Mon Oct 12 00:51:08 2020 -0700 |
tree | 16f523326e689c31f4fb5f52bbf0417faf76233b | |
parent | 5237030d92994002c7adc200089887593fcf2b4b [diff] |
Copy description from Cargo.toml to METADATA Test: make Change-Id: Ia8e99d94fbbf16627ae3882555321f7f7d36a1df
“Small vector” optimization for Rust: store up to a small number of items on the stack
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();