commit | a670ec81179294d145ffa702143a8ac479871f45 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Thu Mar 09 18:06:32 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu Mar 09 18:06:32 2023 +0000 |
tree | b20f2866c1a76f13beb74f38d89e4f93290a0da8 | |
parent | e130e61915094e3d5ea9eddf9389a5a74ceaf94c [diff] | |
parent | a18dbf841b9e47ee299fae975d6cc08204c5c054 [diff] |
Make tinyvec available to product and vendor am: 9dfef5cba3 am: e8eb68870a am: ac443c695f am: a18dbf841b Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/2476528 Change-Id: I9e074e0451899bec1638468238b59cb20f52793b Signed-off-by: Automerger Merge Worker <[email protected]>
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