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

Send/Sync DialogFutureType #200

Closed
wants to merge 3 commits into from

Conversation

jnhyatt
Copy link

@jnhyatt jnhyatt commented Jun 10, 2024

Trying to use async save_file and co. in a context that requires my futures to be Send and Sync and getting errors. Turns out the Future returned by save_file is already Send, but the signature of save_file only guarantees impl Future<...>. We can get the Send guarantee for free by specifying a specific type for the future returned by save_file (and I did the others for consistency).

The change I'm less certain on is adding Sync to DialogFutureType's inner boxed type. It all builds, so I don't think there's a problem with that (haven't tested on wasm) and I don't even think anything I did is a breaking change. If you have a suite of tests to put this through, though, that probably wouldn't be a bad idea.

PS Just looked and I don't think anything I did should affect wasm since DialogFutureType isn't Send on wasm, and I didn't add any trait bounds for that config. So unless I'm way more tired than I'm realizing, this PR shouldn't break anything! 🎉

@jnhyatt
Copy link
Author

jnhyatt commented Jun 10, 2024

Investigating the CI failures. Added a changelog entry but apparently there's a future that's not sync in linux

@jnhyatt
Copy link
Author

jnhyatt commented Jun 10, 2024

After some investigation, I found that adding sync bounds is not only non-trivial, it's probably totally unnecessary. Closing this out

@jnhyatt jnhyatt closed this Jun 10, 2024
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.

1 participant