commit | 60b9cf9692294053cd7a6090fb08be1ce3a6cc35 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Mon Feb 06 15:19:58 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Feb 06 15:19:58 2023 +0000 |
tree | e7ccbbbfb133da56e0cac7a08cc21948ffe3ab7d | |
parent | 497e98b0a08cdbb8b050713c1c1df2f34417a39b [diff] | |
parent | db74ff043cee132bb36db7affc0aad69efc76a70 [diff] |
Upgrade smallvec to 1.10.0 am: db74ff043c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2422379 Change-Id: I0d22cb7dc4724d1e2c1e7a103fd8137323b06465 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
“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();