commit | ac443c695f698a6bcec03de0757dcb99a07e73a9 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <[email protected]> | Thu Mar 09 16:09:09 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Thu Mar 09 16:09:09 2023 +0000 |
tree | b20f2866c1a76f13beb74f38d89e4f93290a0da8 | |
parent | ca58d5b1144161e313f95cbafcc141ead545e138 [diff] | |
parent | e8eb68870abbe4fef7931a5934d4aa4a942859ba [diff] |
Make tinyvec available to product and vendor am: 9dfef5cba3 am: e8eb68870a Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/2476528 Change-Id: If75a0fc74cb8333f54acc37dbd53a22492baced3 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