commit | ce649db3091dbeb99c0fd685dc6ef953e5a04d42 | [log] [tgz] |
---|---|---|
author | Andrew Walbran <[email protected]> | Mon Nov 13 17:17:09 2023 +0000 |
committer | Andrew Walbran <[email protected]> | Mon Nov 13 17:17:09 2023 +0000 |
tree | 85bba2898c7ba5b053d723b80a04dee78593f109 | |
parent | 28ee3e669df78bf94e18d0a22456d6f49dae8669 [diff] |
Migrate to cargo_embargo. Bug: 293289578 Test: Ran cargo_embargo, compared Android.bp Change-Id: I90e23c1a3c68bcb9d400e3710ed6364dcb72ed39
“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();