commit | 8f2129788afc336eaee3610f16ec698e1c869d01 | [log] [tgz] |
---|---|---|
author | David LeGare <legare@google.com> | Wed Mar 02 16:21:23 2022 +0000 |
committer | David LeGare <legare@google.com> | Wed Mar 02 16:21:23 2022 +0000 |
tree | 8a0aaf450d87ced0b38394bff96d3d54d2ee92be | |
parent | c88ecc614cd11e05d6e0cd1dc9b93a5a48c5fccc [diff] |
Update smallvec to 1.8.0 Test: cd external/rust/crates && atest --host -c Change-Id: I2a9bbf3cbe9a9458f13552e4c09e33f231a96b57
"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();