commit | 86a4744d7fc6c894fafe28fc32d664aa0f6699d7 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Wed Dec 23 21:23:37 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Dec 23 21:23:37 2020 +0000 |
tree | 5cab2a24da1c140f31d6e9d61fae9bc4631bb7da | |
parent | e4b23c078b456cf724ecef9ed0e8e1c03460095a [diff] | |
parent | 0468b68bd395e1ca10a6d23ca176f94b17ca152f [diff] |
Allow using tinyvec from DnsResolver am: ea2ddcbf43 am: b9cb5b0e94 am: 0468b68bd3 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/1535149 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ie87a9b3a43f19b4141c11ed51ff255ca105bee84
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