-
Notifications
You must be signed in to change notification settings - Fork 39
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
cw_multi_test: accept closures in new() #6
Comments
The problem is that implementation if |
Yup! totally agree @hashedone - looks like it would require adding more generics everywhere, which would be painful on the library side (but would make the API nicer for users) Also agree, implementing our own custom type is totally workable, the issue here should be thought of more as improving developer experience rather than actually blocking anything important. |
I would put a deep refactor of multi-test before this should be approached (or fix this as part of a refactor). We may be able to simplify the traits and generics if some big brains spend several days focused on it. |
The current implementation makes two restrictive decisions:
impl Fn
)The internal
new()
creator is able to create a closure from the passed-in function pointer, but the current setup disallows the caller to do this too. e.g. it may want to wrap functions before passing them in.Suggestion: change the
new()
functions to accept anyimpl Fn
edit: the Contract trait is
pub
so making the fields onContractWrapper
wouldn't add much. The real blocker is using the simplenew()
methods with closures being passed inThe text was updated successfully, but these errors were encountered: