commit | 7c49fca48b17de6880afcf42737e9d6e18e1d34a | [log] [tgz] |
---|---|---|
author | Joel Galenson <[email protected]> | Tue Jun 01 21:39:59 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Jun 01 21:39:59 2021 +0000 |
tree | 49b6ff005e50a5361a721ac1a73e84d5e4526af4 | |
parent | d4865997bc50dd58de789c40637ebb1e9ab2999e [diff] | |
parent | 9aa887234fcb079e22139c8f4cf7fb2381e18085 [diff] |
Remove patch and use config file. am: 9aa887234f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/smallvec/+/1723362 Change-Id: I8977498edcf234d799e2cb744135b44ded8519fb
“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();