-
-
Notifications
You must be signed in to change notification settings - Fork 87
Description
For similar reasons in #221, I believe it is more flexible to use an opaque type for the time zone abbreviation returned by TimeZone::to_offset instead of a &str. In particular, the &str requires that the abbreviation be borrowed from the TimeZone. In core-only environments, this in turn implies that a fixed offset time zone (the only type of time zone available in such environments at present) has to be converting to a string and stored inline. But if we returned an opaque type, then I believe we could do this string conversion lazily instead of making every TimeZone value pay for it.
This opaque type would still need to be parameterized over a lifetime borrowed from the TimeZone so that we can borrow data from the TimeZone. But in core-only environments, I think this would end up being, effectively, a phantom lifetime.