commit | 871eb4c7c3580fb6469e04c4a622be50f7fcc910 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Tue May 31 15:54:50 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue May 31 15:54:50 2022 +0000 |
tree | 50eda7edf9ae0374b69141200860fcae20ee6799 | |
parent | d930d26b19dc62ed335563e93baa603738aa8467 [diff] | |
parent | d7bd97eae483e3dc63183d6c23b09b635f4b0e05 [diff] |
Update TEST_MAPPING am: d7bd97eae4 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2108153 Change-Id: I59fc628984eb3d02cbf4f1eef2bc7fb2d74a5a0c Signed-off-by: Automerger Merge Worker <[email protected]>
“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();