-
Notifications
You must be signed in to change notification settings - Fork 153
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
Arbitrary Return Types for Register Modification Closures #874
Conversation
Return a generic Just a note. |
Instead of suffix it can be prefix. What about |
Hey great minds think alike, I was just thinking the same thing. I was thinking |
|
Ok well I guess we can tentatively go with |
On a side note, to reduce duplicate code, I think the original methods could invoke the new ones with the generic T filled in. Will look into it later. |
cc @Emilgardis any comments? |
Would it make sense to put this behind a setting? I think not, but somethibg to maybe consider |
We discussed putting it behind a feature gate in the last meeting, but general consensus was against that idea. |
Discussed in #859.
Added
write_and
write_with_zero_and
modify_and
These functions return a
T
. The writer cannot be returned outside of the closure because the lifetime is constrained to remain within the function body.Motivation
My reasons for this change are to allow strong type-state validity:
Thanks @burrbull!