Skip to content

Graduate DataPayloadOr#8163

Open
sffc wants to merge 1 commit into
unicode-org:mainfrom
sffc:graduate-DataPayloadOr
Open

Graduate DataPayloadOr#8163
sffc wants to merge 1 commit into
unicode-org:mainfrom
sffc:graduate-DataPayloadOr

Conversation

@sffc

@sffc sffc commented Jul 1, 2026

Copy link
Copy Markdown
Member

We already use it in icu_datetime, and I want to use it in icu_locale_names. The design is good enough; I would like to graduate this. It's hard for us to change it anyway because it isn't behind an unstable feature.

The only real downside is that it's not obvious when to use this type instead of Option<DataPayload>. It exists to reduce stack sizes, full stop. It deviates from Rust style, but has convenient constructors and methods that make it feel like an Option<DataPayload>.

Changelog

icu_provider: Add type DataPayloadOr (note: it is already in the 1.5.x changelog)

@sffc sffc requested a review from Manishearth as a code owner July 1, 2026 08:45
@sffc sffc requested a review from robertbastian July 1, 2026 08:45

@Manishearth Manishearth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, the API is pretty straightforward.

@sffc

sffc commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@robertbastian robertbastian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment on the docs:

Please don't use the term "word". Rust has a concrete type for what you mean: usize. Word is a bad term because it sometimes doesn't mean the architecture-specific bit-width, but a fixed size data type (and it's also a linguistic term).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants