commit | 90cb51a2e042eb446776f4f86cda3c6d818e2a91 | [log] [tgz] |
---|---|---|
author | Joel Galenson <[email protected]> | Tue Aug 24 18:24:04 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Aug 24 18:24:04 2021 +0000 |
tree | 0c9124e5458bc7501f3104afc5f4bdf2e0db1bd1 | |
parent | 9603682420714246cd328b619d95a68fde962515 [diff] | |
parent | 703b0af731147103f5d8ab234ebe76d5d3d9f362 [diff] |
Update TEST_MAPPING am: 703b0af731 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1806171 Change-Id: I8a03be2935cc7c2264b6891b5b463c89ca04feae
“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();