commit | 44b1240f837efb35816b93aa586ff47ba72dacb9 | [log] [tgz] |
---|---|---|
author | Joel Galenson <[email protected]> | Wed Dec 15 15:28:00 2021 +0000 |
committer | Gerrit Code Review <[email protected]> | Wed Dec 15 15:28:00 2021 +0000 |
tree | 7569440475603d4e38e2f550b90803081226481b | |
parent | dd7deac4d676d29daf106d7732e04f8a56592180 [diff] | |
parent | e13e503060b7f51ad4dd7b6f67ef5f5cd597ae5d [diff] |
Merge "Refresh Android.bp, cargo2android.json, TEST_MAPPING."
“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();