On 02/12/15 02:39, Nick Fitzgerald wrote:
I've created a crate[0] that provides a mostly drop-in replacement of
std::string::String but with inline storage for small strings to avoid heap
allocation.
[0]https://github.com/fitzgen/inlinable_string
There’s also [1], already in used in Servo in some places, which behaves
like Vec<T> but stores items inline up to a certain length. I’ve also
been playing with [2] to be like String but with a generic backing
storage. (I’ve used it in [3] to return a single code point in UTF-8 as
StringWrapper<[u8; 4]>.)
Would it make sense to converge with some of these?
[1] https://github.com/servo/rust-smallvec
[2]
https://github.com/SimonSapin/rust-std-candidates/blob/master/string-wrapper/lib.rs
[3] https://github.com/SimonSapin/rust-utf8
--
Simon Sapin
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo