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