Graduate DataPayloadOr#8163
Open
sffc wants to merge 1 commit into
Open
Conversation
Manishearth
approved these changes
Jul 1, 2026
Manishearth
left a comment
Member
There was a problem hiding this comment.
I think this is fine, the API is pretty straightforward.
Member
Author
|
@robertbastian Docs explaining why this type exists and what it does |
robertbastian
approved these changes
Jul 3, 2026
robertbastian
left a comment
Member
There was a problem hiding this comment.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 anOption<DataPayload>.Changelog
icu_provider: Add type DataPayloadOr (note: it is already in the 1.5.x changelog)