commit | 27080cf85d340dbcfae158b295c5d724af40811e | [log] [tgz] |
---|---|---|
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | Thu Jul 11 16:33:31 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Jul 11 16:33:31 2024 +0000 |
tree | 6efa95f63d3555804589e641ae94d9515d6276c9 | |
parent | c00dd13f1110b0d93938c08d99a9d6bc4209778d [diff] | |
parent | 186e8f9d6c52617caed1bcaa1e8892f3792710ca [diff] |
Merge "Mark apex-available" into main am: 186e8f9d6c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/3165871 Change-Id: I41da9f3343c3ddb4a0ae0fc13d3e7f31b282694b 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();