commit | 9aa887234fcb079e22139c8f4cf7fb2381e18085 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Jun 01 11:09:37 2021 -0700 |
committer | Joel Galenson <jgalenson@google.com> | Tue Jun 01 11:09:37 2021 -0700 |
tree | 49b6ff005e50a5361a721ac1a73e84d5e4526af4 | |
parent | 784e24eb3f0c100bb3f2da234330b8d93b27b722 [diff] |
Remove patch and use config file. Test: Build Test: Run cargo2android.py. Change-Id: Ie22609d29543b15c87df50ef1289e42f4cff2898
"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();