commit | 749c5330428d8755d1c170e2f242293362ad1201 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Aug 24 18:48:26 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Aug 24 18:48:26 2021 +0000 |
tree | 0c9124e5458bc7501f3104afc5f4bdf2e0db1bd1 | |
parent | 9603682420714246cd328b619d95a68fde962515 [diff] | |
parent | 90cb51a2e042eb446776f4f86cda3c6d818e2a91 [diff] |
Update TEST_MAPPING am: 703b0af731 am: 90cb51a2e0 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1806171 Change-Id: I2fbede1e48fbf4d98156eb6c48fa8eecaa8bbc0a
"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();