commit | 7080eb50e93caac826d15fa858f3394a5e1dfd40 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Tue Oct 19 21:32:45 2021 +0200 |
committer | Jeff Vander Stoep <jeffv@google.com> | Tue Oct 19 21:39:00 2021 +0200 |
tree | 6451c178fd78b37754d01bf4ee0c1ee8f02e3fd9 | |
parent | faca07c8c3443821cd70f601dca4dc2dfe62e35d [diff] |
Enable tests Test: atest ------- x86_64 tinyvec_host_test_tests_arrayvec: Passed: 14, Failed: 0, Ignored: 0, Assumption Failed: 0, x86_64 tinyvec_host_test_tests_tinyvec: Passed: 13, Failed: 0, Ignored: 0, Assumption Failed: 0, x86 tinyvec_device_test_tests_arrayvec: Passed: 14, Failed: 0, Ignored: 0, Assumption Failed: 0, x86 tinyvec_device_test_tests_tinyvec: Passed: 13, Failed: 0, Ignored: 0, Assumption Failed: 0, Change-Id: I21f07c389a824e36cd4b0e59c756c45acbd45ffc
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