commit | d7bd97eae483e3dc63183d6c23b09b635f4b0e05 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Thu May 26 12:28:09 2022 -0700 |
committer | Matthew Maurer <[email protected]> | Thu May 26 12:28:09 2022 -0700 |
tree | 50eda7edf9ae0374b69141200860fcae20ee6799 | |
parent | 426246d39500cfa4e261f4de5981de545ee12f60 [diff] |
Update TEST_MAPPING Test: None Bug: 233924440 Change-Id: I8f8e52379b7eb8fd6df79d14564694053ce0370b
“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();