Bug: 159603647

Clone this repo:
  1. 784e24e Configure apex so crosvm can depend on this crate by Jorge E. Moreira · 3 weeks ago main-cg-testing-release master
  2. 2188055 Mark ab/7061308 as merged in stage. by Xin Li · 3 months ago
  3. c37fb7e Merge "[LSC] Add LOCAL_LICENSE_KINDS to external/rust/crates/smallvec" am: da1557c4d0 by Treehugger Robot · 3 months ago
  4. da1557c Merge "[LSC] Add LOCAL_LICENSE_KINDS to external/rust/crates/smallvec" by Treehugger Robot · 3 months ago android-s-preview-1
  5. 377ba20 Clean up rust_test_host TEST_MAPPING after default update am: cadc338164 by Julien Desprez · 3 months ago

rust-smallvec

Documentation

Release notes

“Small vector” optimization for Rust: store up to a small number of items on the stack

Example

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();