commit | 377ba206c2242357c54815ec599fbf15ce86cbc7 | [log] [tgz] |
---|---|---|
author | Julien Desprez <[email protected]> | Tue Feb 16 18:46:06 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Feb 16 18:46:06 2021 +0000 |
tree | 84b51f59d067af4c9085d1c4906cd52339aa29ee | |
parent | 4a11a20bb369311bef160bb432a4c2c1098eb320 [diff] | |
parent | cadc338164e840757b5b17d3d76f21bb59d8f76a [diff] |
Clean up rust_test_host TEST_MAPPING after default update am: cadc338164 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1590018 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I22ac62175103116cf2633f9452becb745a2d74f8
“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();