commit | 0447cae9a04753bda054b186f8144d0c2a2f0af7 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Feb 01 14:13:11 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Feb 01 14:13:11 2023 +0000 |
tree | d43d23645a9759d44228504ec1c8c8a680dbf82a | |
parent | dd3ab95937dc949547745ad5b13d4db503399e24 [diff] | |
parent | e130e61915094e3d5ea9eddf9389a5a74ceaf94c [diff] |
Snap for 9550733 from e130e61915094e3d5ea9eddf9389a5a74ceaf94c to mainline-tzdata5-release Change-Id: Ib9f41d68b9270037906eebcccf523419185a8a5e
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