Conversation
Ekleog
approved these changes
Mar 15, 2025
Owner
Ekleog
left a comment
There was a problem hiding this comment.
LGTM! Just two small style nits, I'm committing them to your branch and merging 😄
Owner
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.
close #5
Note this constitutes a breaking change, and means only Rust>=1.85 is supported
Regarding the Rust>=1.85, another solution to avoid this would be to put async closure support under a feature.
This is a bit trick though: since
Faction::open&TransactionBuilder::runwould have two flavors of signature.To do that there is basically three ways:
Faction::open&TransactionBuilder::runbodiesFaction::open&TransactionBuilder::runbody inside a macro which is called in each flavor of the functionsFaction::open&TransactionBuilder::runinternally calles the sync-closure -returning-futureSolution 3 seems the most elegant, however it only works because the async closure is
'static.If that wasn't the case we would in theory need to use a
unsafe std::mem::transmuteto overwrite the lifetime of the async closure before passing it toopen_internal... but even this doesn't work in practice:impl AsyncFnOnce()into aimpl AsyncFnOnce() + 'staticcannot be expressed as far as I'm aware (as there is no way in telling the resultingimpl AsyncFnOnce() + 'statichave the same size than theimpl AsyncFnOnce()provided as input)unsafe_jar::runrelies onwasm_bindgen::Closure::oncewhich itself requires the passed closure to be'static