commit | 88f8ef87938627ae9f20f33f131c3c7b79dc458a | [log] [tgz] |
---|---|---|
author | David LeGare <[email protected]> | Wed Mar 02 19:54:35 2022 +0000 |
committer | David LeGare <[email protected]> | Tue Mar 08 18:03:40 2022 +0000 |
tree | da86de748981dd96113865df11834b360d9da02b | |
parent | 8f2129788afc336eaee3610f16ec698e1c869d01 [diff] |
Update TEST_MAPPING Test: cd external/rust/crates && atest --host -c Change-Id: Ib48a7fe57c6a644e1a44c3d697146c3fec568edd
“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();