Benjamin Scherer 478a8a0124 Make capacity() methods not rely on Array::CAPACITY (#83)
* Make capacity() methods not rely on Array::CAPACITY

Because Array isn't an unsafe trait, unsafe code cannot depend on the
length of a slice produced by Array::as_slice to be at least as long as
Array::CAPACITY. This means that unsafe code also cannot depend on
capacity() methods that return Array::CAPACITY. Returning the result of
a slice len() call ensures that if nothing else, with a sound
implementation of Array, capacity() methods will return a valid length
for a sub-slice of the backing array.

* Add comments explaining choice against using Array::CAPACITY
2020-07-15 21:02:26 -06:00
2020-01-06 19:29:40 -07:00
2020-07-03 21:36:03 -06:00
2020-01-13 20:06:35 -07:00
2020-01-06 19:29:40 -07:00
2020-01-06 19:29:40 -07:00

License:Zlib Minimum Rust Version travis.ci AppVeyor crates.io docs.rs

Unsafe-Zero-Percent

tinyvec

A 100% safe crate of vec-like types.

For details, please see the docs.rs documentation

S
Description
安全的 vec-like 类型库
Readme 845 KiB
Languages
Rust 99.5%
Python 0.3%
Shell 0.2%