commit | 2b8efd428cb1e17fc33e343aad8bb4d4321d30e1 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Mar 08 20:32:59 2022 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue Mar 08 20:32:59 2022 +0000 |
tree | 8a0aaf450d87ced0b38394bff96d3d54d2ee92be | |
parent | 38a95dd734eb4e673047a2fd4b9943a2cdd921d6 [diff] | |
parent | 8f2129788afc336eaee3610f16ec698e1c869d01 [diff] |
Merge "Update smallvec to 1.8.0"
“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();