Bug: 159603647

Clone this repo:
  1. fb9345f Upgrade smallvec to 1.13.1 am: 1f97ab5903 by Jeff Vander Stoep · 2 months ago main master
  2. 1f97ab5 Upgrade smallvec to 1.13.1 by Jeff Vander Stoep · 2 months ago
  3. a3484a3 Migrate to cargo_embargo. am: ce649db309 am: 04091f7205 am: c52038c074 by Andrew Walbran · 5 months ago
  4. a35c026 Migrate to cargo_embargo. am: ce649db309 am: 5d9d02fb0f am: 3654b9002a by Andrew Walbran · 5 months ago
  5. c52038c Migrate to cargo_embargo. am: ce649db309 am: 04091f7205 by Andrew Walbran · 5 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();