Empty String?
I am not quite following the argument that prevents the empty string from being a thing? I get that there's probably a reason, but I didn't spot it in a quick scan of the source.
The original motivation is mostly that they types they were replacing (in fluent-locale-rs) was Option<String>. And tags in locales can never be empty strings. So the idea was that by using a NonZero as the backing store, we would be able to preserve those semantics while also being very efficient.
It would certainly be possible to support a variant that allowed the empty string but would not be as efficient when wrapped in an Option. It didn't meet the needs of fluent so it wasn't included. I hope this clarifies.
It does. I am thinking seriously about taking my current code, now that the files are merged, and changing it from macro-based to trait-based. At that point adding the corresponding nullable types would be almost free. I'll poke at it and let you know.
@bartmassey - do you think I should wait for your pr or cut out a release for tinystr16 already?
Don't feel strongly, but I think you might as well cut a release unless it's a lot of trouble? I don't expect the API to change in a backward-incompatible way at this point, but I think that's true of this change as well?
We now allow empty strings.