Skip to content

return an opaque type for time zone name abbreviations in TimeZone::to_offset #222

@BurntSushi

Description

@BurntSushi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changeIssues that require a breaking change for resolution.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions