commit | 1f9689c34d31abaa697e5915cc69492863a208f0 | [log] [tgz] |
---|---|---|
author | Julien Desprez <[email protected]> | Tue Feb 16 20:40:20 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Feb 16 20:40:20 2021 +0000 |
tree | 84b51f59d067af4c9085d1c4906cd52339aa29ee | |
parent | 86ef446a7618fdd87bcbbd9c1fa84b1095005fb0 [diff] | |
parent | 2d75ee73757afe796d25590f41c4ce5d9767ff63 [diff] |
Clean up rust_test_host TEST_MAPPING after default update am: cadc338164 am: 377ba206c2 am: 26e034191c am: 2d75ee7375 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1590018 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I078ec01b0856d429a581d1ac128c017e14bf371c
“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();