| commit | 987dcdf892952275ea5c2329b16975505166955d | [log] [tgz] |
|---|---|---|
| author | Android Build Coastguard Worker <[email protected]> | Wed Sep 11 23:30:18 2024 +0000 |
| committer | Android Build Coastguard Worker <[email protected]> | Wed Sep 11 23:30:18 2024 +0000 |
| tree | 4ccc9609d29c6f2484dc04b212e0e378d43ca51c | |
| parent | 23063c4bb932262da421c4090717613d2accd7ba [diff] | |
| parent | 2b2231c2c1a14660dcf8c08072cc1347287a2262 [diff] |
Snap for 12355814 from 2b2231c2c1a14660dcf8c08072cc1347287a2262 to build-tools-release Change-Id: Ia788e4245a437e1f783e706f425dea63e125d31d
“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();