commit | f8031992296b035196c212a1ae61376636fb614f | [log] [tgz] |
---|---|---|
author | Joel Galenson <[email protected]> | Tue Oct 12 15:50:19 2021 +0000 |
committer | Automerger Merge Worker <[email protected]> | Tue Oct 12 15:50:19 2021 +0000 |
tree | 3213722d927484b07274e13ba5428f1a8f51ed89 | |
parent | eae301df06074d2329ff6e316e1ba7f6da4ccf73 [diff] | |
parent | ad2a75412f2062e34a2a3d9a1ed6154ecf69c2b9 [diff] |
Merge "Upgrade rust/crates/tinyvec to 1.4.0" am: faca07c8c3 am: 2a02945678 am: c7c5b1748f am: ad2a75412f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/1833326 Change-Id: I0ff8be2b12ad90278ab84e5ba38756711a0793d8
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