commit | e13e503060b7f51ad4dd7b6f67ef5f5cd597ae5d | [log] [tgz] |
---|---|---|
author | Joel Galenson <[email protected]> | Mon Nov 29 14:05:27 2021 -0800 |
committer | Joel Galenson <[email protected]> | Fri Dec 10 15:33:30 2021 -0800 |
tree | 7569440475603d4e38e2f550b90803081226481b | |
parent | 90cb51a2e042eb446776f4f86cda3c6d818e2a91 [diff] |
Refresh Android.bp, cargo2android.json, TEST_MAPPING. Test: None Change-Id: I1b627bb8cfed145b7ffbd25c8bee8cfc404cf054
“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();