commit | ffe606899b9aa6df923397ef330fbaf67b4e3e4b | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Jun 01 22:27:35 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 01 22:27:35 2021 +0000 |
tree | 49b6ff005e50a5361a721ac1a73e84d5e4526af4 | |
parent | 7728b23a4c8c9fe64126df78c24d366aad6720cb [diff] | |
parent | 9603682420714246cd328b619d95a68fde962515 [diff] |
Remove patch and use config file. am: 9aa887234f am: 7c49fca48b am: 9603682420 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1723362 Change-Id: I97d0466bd7c5957f9a6834ba921bfd5449ea0b62
"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();