commit | 21ef8b2f6c36ae36a5c8a60b3a3308dd28636aef | [log] [tgz] |
---|---|---|
author | David Brazdil <dbrazdil@google.com> | Mon Jan 23 14:06:47 2023 +0000 |
committer | David Brazdil <dbrazdil@google.com> | Mon Jan 23 14:06:47 2023 +0000 |
tree | c06998c37534be1b9d30add75d8673d84b921070 | |
parent | f109aafcc28a8b8e7726e4c8c058f168ebb0efa4 [diff] |
Update TEST_MAPPING Test: None Change-Id: Ia3d5f2b8ad3e9657470925c4bb5987028aa9c422
“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();