commit | 0b523b58651686150ba2470d00685abefb9b06ca | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Feb 02 23:55:50 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Feb 02 23:55:50 2024 +0000 |
tree | 18af4f5ec90bd2bf1c1df2dd3d030f539b1a6d21 | |
parent | 456c579f1b2d54e3b662c7d524c4f9881d8cbd24 [diff] | |
parent | fbe18b59cfe47697cc2aab958fbbe91aa9e3c2f3 [diff] |
Snap for 11400057 from fbe18b59cfe47697cc2aab958fbbe91aa9e3c2f3 to simpleperf-release Change-Id: I01f45a529ee09a3d584dcab2289c19bb002deb18
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