commit | 63392064a91328a27cc3446d456de94406288c1e | [log] [tgz] |
---|---|---|
author | android-build-team Robot <android-build-team-robot@google.com> | Fri May 14 16:52:04 2021 +0000 |
committer | android-build-team Robot <android-build-team-robot@google.com> | Fri May 14 16:52:04 2021 +0000 |
tree | 374e6263abc26a82e70c06ffcb32122ace1036af | |
parent | 23c63539cd68aedad89eb2b726f60debacfd90f9 [diff] | |
parent | 863b9e67c6ec84ab45a3dcf8673ecb7199c61a52 [diff] |
Snap for 7362376 from 863b9e67c6ec84ab45a3dcf8673ecb7199c61a52 to sc-mainline-release Change-Id: I7c591248b1d6598f25f2da5b9c59fe0042dfb95f
A 100% safe crate of vec-like types. #![forbid(unsafe_code)]
Main types are as follows:
ArrayVec
is an array-backed vec-like data structure. It panics on overflow.SliceVec
is the same deal, but using a &mut [T]
.TinyVec
(alloc
feature) is an enum that's either an Inline(ArrayVec)
or a Heap(Vec)
. If a TinyVec
is Inline
and would overflow it automatically transitions to Heap
and continues whatever it was doing.To attain this “100% safe code” status there is one compromise: the element type of the vecs must implement Default
.
For more details, please see the docs.rs documentation