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