commit | d4eff4d3b197961c5c13658c433e0bf6f9218a8f | [log] [tgz] |
---|---|---|
author | Andrew Walbran <qwandor@google.com> | Fri May 12 13:58:27 2023 +0000 |
committer | Andrew Walbran <qwandor@google.com> | Fri May 12 13:58:51 2023 +0000 |
tree | 18e54538c3519d090abf406f41563b06a5ae5a76 | |
parent | e8eb68870abbe4fef7931a5934d4aa4a942859ba [diff] |
Use new no-std flag to cargo2android. Bug: 279614907 Test: Ran cargo2android and compared Android.bp Change-Id: I3a074a22c09c8a2ced5b09c98ab54843445d4b8c
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