by jez · 4y ago · 0 comments
Some quick searching turned up a few rust-lang internals posts and GitHub issues, but it was hard to see whether anything came of them.
I understand that it’s probably possible to implement a comparable String API in a crate that uses small string optimizations, but being able to avoid a dedicated crate makes interoperability with other libraries much easier.
The as_mut_vec function doesn't even really prevent Rust's standard String type from implementing SSO. That function, which is already unsafe, could just come with a warning in the documentation that calling it will force the string into its heap-allocated form.
But no, I don't care enough about this to do the work myself, so I'll say no more.