I created this because I found myself cloning String all the time while working on a large project. Essentially, I had several HashMaps and no simple way to borrow the String for the lifetime I needed so ended up with several clones. It seemed silly to me to be copying string data over and over when most strings are immutable.
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.
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.