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

Move map_project to closures #2185

Merged
merged 6 commits into from
Jul 15, 2022

Conversation

Manishearth
Copy link
Member

Fixes #1061

This moves the Yoke map_project functions all over to using closures, and also ensures that the closurefull functions have full functionality.

This does not remove the _with_capture functions from Yoke, however it renames them to _with_explicit_capture. As a util crate Yoke can always remove them in the future, but holding on to them gives us a wider range of Rust version support in Yoke.

ICU4X DataPayload does not do this: it only has the closure APIs. If something breaks in the compiler in the future it should not be hard for us to re-add _with_explicit_capture APIs as needed, but it's cleaner to not start with them. I'm also adding tests upstream (rust-lang/rust#99257).

@sffc
Copy link
Member

sffc commented Jul 15, 2022

CI is stuck

@sffc sffc closed this Jul 15, 2022
@sffc sffc reopened this Jul 15, 2022
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Mostly LGTM!

utils/yoke/src/yoke.rs Outdated Show resolved Hide resolved
provider/core/src/data_provider.rs Show resolved Hide resolved
@Manishearth Manishearth requested review from sffc and removed request for nordzilla July 15, 2022 16:41
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

One more docs thing

@Manishearth Manishearth requested a review from sffc July 15, 2022 21:58
@Manishearth Manishearth merged commit 7b38fc6 into unicode-org:main Jul 15, 2022
@Manishearth Manishearth deleted the map-project-clean branch July 15, 2022 23:07
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.

Remove workarounds for Rust bugs in Yoke, DataPayload
2 participants