You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently superstruct uses a fn type for the closure passed to a mapping macro, meaning that variables can't be captured.
The reason we use fn is that it's a reliable type-hint that helps disambiguate things for the compiler. It would be interesting to investigate alternatives, like hinting only on the arguments/return value, or using something like a const or static assert.
The text was updated successfully, but these errors were encountered:
Currently superstruct uses a
fn
type for the closure passed to a mapping macro, meaning that variables can't be captured.The reason we use
fn
is that it's a reliable type-hint that helps disambiguate things for the compiler. It would be interesting to investigate alternatives, like hinting only on the arguments/return value, or using something like a const or static assert.The text was updated successfully, but these errors were encountered: