Specifically, this iterator: https://docs.rs/jiff/latest/jiff/tz/struct.TimeZoneNameIter.html
Currently, it always yields a String. But this is somewhat restrictive and requires alloc. I think we should also parameterize it over a lifetime borrowed from the originating TimeZoneDatabase. And then add an as_str<'a>(&'a self) -> &'a str method (specifically with a lifetime attached to the value yielded and not the TimeZoneDatabase, so as to permit Cow shenanigans or an owned representation internally). I think this is perhaps overly restrictive, but it is maximally flexible from an API evolution perspective.
I will probably keep the API alloc-only for jiff 0.2, so there won't be any immediate improvement here. But it at least gives us a chance to evolve it in semver compatible ways should the need arise.
Specifically, this iterator: https://docs.rs/jiff/latest/jiff/tz/struct.TimeZoneNameIter.html
Currently, it always yields a
String. But this is somewhat restrictive and requiresalloc. I think we should also parameterize it over a lifetime borrowed from the originatingTimeZoneDatabase. And then add anas_str<'a>(&'a self) -> &'a strmethod (specifically with a lifetime attached to the value yielded and not theTimeZoneDatabase, so as to permitCowshenanigans or an owned representation internally). I think this is perhaps overly restrictive, but it is maximally flexible from an API evolution perspective.I will probably keep the API
alloc-only forjiff 0.2, so there won't be any immediate improvement here. But it at least gives us a chance to evolve it in semver compatible ways should the need arise.