commit | daecbc2192cd23153a6094c2b41aa21a82c07735 | [log] [tgz] |
---|---|---|
author | Pierre-Clément Tosi <ptosi@google.com> | Mon Nov 28 10:54:08 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Nov 28 10:54:08 2022 +0000 |
tree | 94b0b9e937fc6fe363cbf7147ae86d656cc6dd3a | |
parent | 9f286aaa507fdb58e04f3bbd4d7eaea5e4ee3ca7 [diff] | |
parent | 7388ef014620436064aa9e87f50f2f6c5e153f5a [diff] |
Enable upstream feature 'std' am: 7388ef0146 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/2318989 Change-Id: I7c9794bf9bdd437ce0fba93dd49995a4c4593c1c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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