commit | 7bfc8153113857f16b7560638faa7c9e30883e8d | [log] [tgz] |
---|---|---|
author | android-build-team Robot <android-build-team-robot@google.com> | Thu May 13 02:02:35 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu May 13 02:02:35 2021 +0000 |
tree | 374e6263abc26a82e70c06ffcb32122ace1036af | |
parent | e46d001505a5384bae0f4203681fecf943f17fbd [diff] | |
parent | 2ee96ba34e518981842394c3fb7fd5e04dd64870 [diff] |
Snap for 7357013 from 863b9e67c6ec84ab45a3dcf8673ecb7199c61a52 to sc-release am: 2ee96ba34e Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/14522721 Change-Id: Idb17ffb13b3c54789aebca3fb0a9240440c6d29f
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