commit | a42947bd3a56aeb1c57967aabc94b3d5347909eb | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Tue Oct 12 16:13:33 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Oct 12 16:13:33 2021 +0000 |
tree | 3213722d927484b07274e13ba5428f1a8f51ed89 | |
parent | ecae8209dc984b94ce3255078fc76c3b66e486ae [diff] | |
parent | f8031992296b035196c212a1ae61376636fb614f [diff] |
Merge "Upgrade rust/crates/tinyvec to 1.4.0" am: faca07c8c3 am: 2a02945678 am: c7c5b1748f am: ad2a75412f am: f803199229 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/1833326 Change-Id: I0e11808d2670cb15798c79f26d82f4d94c21e912
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