commit | 76fd734e7f2b76c359e2e849afe60291fbaf26d8 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <[email protected]> | Mon Feb 06 16:13:43 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Mon Feb 06 16:13:43 2023 +0000 |
tree | e7ccbbbfb133da56e0cac7a08cc21948ffe3ab7d | |
parent | daf9ec3a3e4037974a8b343267048faba26b16d4 [diff] | |
parent | 60b9cf9692294053cd7a6090fb08be1ce3a6cc35 [diff] |
Upgrade smallvec to 1.10.0 am: db74ff043c am: 60b9cf9692 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2422379 Change-Id: Ife4a472628ae6a6519685e7a2a3db06b8aed0c22 Signed-off-by: Automerger Merge Worker <[email protected]>
“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();