sdleffler / qp-trie-rs

An idiomatic and fast QP-trie implementation in pure Rust.
Mozilla Public License 2.0
94 stars 24 forks source link

Wrapper types for str and String #3

Closed sdleffler closed 7 years ago

sdleffler commented 7 years ago

str and String currently do not implement Borrow<[u8]> because a string will hash differently when converted to a byte slice. A wrapper type should be included which wraps a str, implements ToOwned to a wrapper type for String, and both should implement Borrow<[u8]> and also a hash implementation which simply converts them to their byte slice and hashes that.