commit | a0f8acf004a41fa3c68b1f4b32ee7201bd70fb06 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Tue Jun 14 17:11:29 2022 -0700 |
committer | Matthew Maurer <[email protected]> | Tue Jun 14 17:11:29 2022 -0700 |
tree | e3c3e822585ae016995730950b05fc47a5c680f2 | |
parent | d7bd97eae483e3dc63183d6c23b09b635f4b0e05 [diff] |
Update TEST_MAPPING Test: None Bug: 236006683 Change-Id: I80e248269b61b391d4fc65a89437ec2807058ef9
“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();