Anonymous function: Difference between revisions

Content deleted Content added
m List of languages: Fixed the link to redirect to Zig programming language and not Zig
In Rust, to omit the curly braces in a closure, the return type must be inferred
Line 1,572:
</syntaxhighlight>
 
With closures with a single expression (i.e. a body with one line) and implicit return type, the curly braces may be omitted:
<syntaxhighlight lang="rust">
let f = |x| x * 2;