Allow using tinyvec from DnsResolver

Test: m
Bug: 155855709
Change-Id: Ic40a87d482e659b89537a7ea4d5075303a28204a
3 files changed
tree: 5cab2a24da1c140f31d6e9d61fae9bc4631bb7da
  1. .cargo_vcs_info.json
  2. .github/
  3. .gitignore
  4. Android.bp
  5. CHANGELOG.md
  6. Cargo.toml
  7. Cargo.toml.orig
  8. LICENSE-APACHE.md
  9. LICENSE-MIT.md
  10. LICENSE-ZLIB.md
  11. METADATA
  12. MODULE_LICENSE_APACHE2
  13. OWNERS
  14. README.md
  15. benches/
  16. gen-array-impls.sh
  17. patches/
  18. rustfmt.toml
  19. src-backup/
  20. src/
  21. tests/
README.md

License:Zlib Minimum Rust Version crates.io docs.rs

Unsafe-Zero-Percent

tinyvec

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