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