commit | 2c1fef0e975dd821f785ef48b31adcc0d4bc046b | [log] [tgz] |
---|---|---|
author | Maurice Lam <[email protected]> | Mon Dec 18 23:14:06 2023 +0000 |
committer | Automerger Merge Worker <[email protected]> | Mon Dec 18 23:14:06 2023 +0000 |
tree | 18af4f5ec90bd2bf1c1df2dd3d030f539b1a6d21 | |
parent | 27a77f5a87aea0aa2f072fd1399f4691dd185715 [diff] | |
parent | 52793f032f7060c9bd3e2d0539b87683fb6ca8d0 [diff] |
Add rustc_1_57 feature to tinyvec am: fbe18b59cf am: 52793f032f Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/tinyvec/+/2880490 Change-Id: I4ae31c3c012567575735078615d0da75698af529 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