Registry / utility / smallvec

smallvec

JSON →
library1.15.2rscratesunverified

A 'small vector' optimization that stores up to a small number of items on the stack before heap-allocating.

# Cargo.toml [dependencies] smallvec = "1.15.2"
INSTALL
IMPORT
SIG · SMALLVEC
S
smallvec
utilityrustv1.15.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SmallVec
use smallvec::SmallVec;

Creates a SmallVec with a stack capacity of 4 elements.

use smallvec::SmallVec; let mut vec: SmallVec<[i32; 4]> = SmallVec::new(); vec.push(1); vec.push(2); assert_eq!(vec.len(), 2);
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.15.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
smallvec — cargo add smallvec · libregistry