commit | 5edf2a06f26675f30f67e8729fa708a5167e0bf0 | [log] [tgz] |
---|---|---|
author | James Farrell <jamesfarrell@google.com> | Tue May 21 19:01:02 2024 +0000 |
committer | James Farrell <jamesfarrell@google.com> | Wed May 22 13:51:35 2024 +0000 |
tree | 7872e8d542897450d9a437be1d1a3c7308e08b19 | |
parent | 3de05fa51605b3a106364e74240c499663e1b902 [diff] |
Update Android.bp by running cargo_embargo Test: ran cargo_embargo Change-Id: I11ecb59c653f92b2d839beef53bd6f637b99c2c5
“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();