commit | 7388ef014620436064aa9e87f50f2f6c5e153f5a | [log] [tgz] |
---|---|---|
author | Pierre-Clément Tosi <ptosi@google.com> | Fri Nov 25 17:42:41 2022 +0000 |
committer | Pierre-Clément Tosi <ptosi@google.com> | Fri Nov 25 18:11:34 2022 +0000 |
tree | 94b0b9e937fc6fe363cbf7147ae86d656cc6dd3a | |
parent | 483f46228ded54aec62d5eb2eba69415a24c9c7d [diff] |
Enable upstream feature 'std' Instead of force-patching lib.rs, remove the ![no_std] attribute through the upstream feature 'std', which was added in 1.5.0 [1]. Update Android.bp by running cargo2android.py. [1]: https://github.com/Lokathor/tinyvec/pull/152 Test: TH Change-Id: Idea781c1ad3f8a4b1ebec7c651b7081feff581ff
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