commit | cfe4c678e3381d05752ca8f985d3713329984c3f | [log] [tgz] |
---|---|---|
author | Joel Galenson <[email protected]> | Wed Dec 15 18:06:52 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Wed Dec 15 18:06:52 2021 +0000 |
tree | 56a6967701ac6101a0d79dd61724d3a4587ceb7a | |
parent | 52065d7bff0cd6ee419aac6e89c6a9c70d478738 [diff] | |
parent | ea08e0e871a76c38dd763eb77bb35256c918d942 [diff] |
Merge "Refresh Android.bp, cargo2android.json, TEST_MAPPING." am: 3a423cbd39 am: 64d6692d06 am: 102265a9fc am: ea08e0e871 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/1912690 Change-Id: I2c7d969c2e55118d14dee9e2fa7ded13caf8ab4f
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