commit | 5237030d92994002c7adc200089887593fcf2b4b | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Tue Sep 29 15:59:07 2020 +0000 |
committer | Gerrit Code Review <[email protected]> | Tue Sep 29 15:59:07 2020 +0000 |
tree | 016def8e169faec1a21e319a82de77ec852c2ccd | |
parent | 5986c40c21100f7fe0f624ea3969fe2b5dedba7d [diff] | |
parent | b9330f0c56e6a7994bd421b0b722496b28b7bd89 [diff] |
Merge "Upgrade rust/crates/smallvec to 1.4.2"
“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();