Show HN: FlexStr – An immutable, clone-efficient String replacement for Rust
github.com
github.com
Additionally, I wanted a type that would combine string literals with heap based strings as I found myself often having struct fields that could be a literal or a heap allocated String. I ended up allocating in several cases for something that was already static.
The inline string type is due to needing some very short string creation from primitives and it seemed wasteful to do a heap allocation.
I was kinda suprised nobody had created a string type like this yet. There were several candidates for inline strings, some that did ref counted strings, but I couldn't find a string crate that did all three.