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
While the Rust-native way would be a construct like this:
let f = |d| calculate(d, x);
For further reference, you may also have a look at the reference.
I think it would be better to alter the syntax and transition to the native closure syntax for more comfort during development.
But as of now, this is not an urgent topic.
The text was updated successfully, but these errors were encountered:
Not exactly. The type of the above statements in my comment both produce a value, the return value of calculate. The semicolon in your example is too much.
let f = |d| -> i32{calculate(d, x)};
But this is explained in the reference along with the grammar rules that form such an expression.
The current semantic is:
While the Rust-native way would be a construct like this:
For further reference, you may also have a look at the reference.
I think it would be better to alter the syntax and transition to the native closure syntax for more comfort during development.
But as of now, this is not an urgent topic.
The text was updated successfully, but these errors were encountered: