commit | 348b914db6ce67e0a3994ab388aca772207083e1 | [log] [tgz] |
---|---|---|
author | David Brazdil <dbrazdil@google.com> | Tue Jan 24 17:23:06 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jan 24 17:23:06 2023 +0000 |
tree | c06998c37534be1b9d30add75d8673d84b921070 | |
parent | f109aafcc28a8b8e7726e4c8c058f168ebb0efa4 [diff] | |
parent | 21ef8b2f6c36ae36a5c8a60b3a3308dd28636aef [diff] |
Update TEST_MAPPING am: 21ef8b2f6c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/2399513 Change-Id: Iee6624100960eed4f9bb76eb7a8edfa650f955e8 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();