Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DataPayload::from_static_ref in databake #3500

Merged
merged 5 commits into from
Jun 7, 2023

Conversation

robertbastian
Copy link
Member

@robertbastian robertbastian commented Jun 7, 2023

This allows inlining the lookup functions and AnyProvider to be backed by DataProvider.

I've also inlined the skeletons special case, as it's only called in one location now and I don't like having the hacky zerocopy on the API.

#2945

@Manishearth
Copy link
Member

Any particular reason for killing the lookup method? It feels like it's still neater for diagnostics and debugging.

Manishearth
Manishearth previously approved these changes Jun 7, 2023
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

r=me but i kinda liked the separate lookup method, it felt cleaner. We don't have to call it from other spots; it's fine even if it's called just once

(also: the lack of .data.rs for the macro files is kinda annoying, not opposed to that fix being rolled into this PR as well. I'm okay with macros.rs still being .rs)

@robertbastian
Copy link
Member Author

robertbastian commented Jun 7, 2023

Any particular reason for killing the lookup method? It feels like it's still neater for diagnostics and debugging.

It simplifies adding the fallback (#3487), because we need to put the resolved locale in the metadata. With an inlined #lookup expression it's much simpler, because we can access load's local variables, with a separate fn lookup we'd have to return Result<(&'static #data_struct, Option<DataLocale>), DataErrorKind> which I think gets messy.

@robertbastian
Copy link
Member Author

(also: the lack of .data.rs for the macro files is kinda annoying, not opposed to that fix being rolled into this PR as well. I'm okay with macros.rs still being .rs)

Why is that annoying? They're still marked as generated files.

@Manishearth
Copy link
Member

Yeah but you can no longer make them go away completely in the github review view

@robertbastian robertbastian merged commit 5e92ca1 into unicode-org:main Jun 7, 2023
22 checks passed
@robertbastian robertbastian deleted the ref branch June 7, 2023 11:36
@sffc sffc removed their request for review June 8, 2023 16:15
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.

None yet

2 participants