Post History
Avoid type annotations with a closure instead of a fn Function (24 bytes) A function requires types to be specified for its return value, and for any arguments it takes. fn f(a:u8,b:u8)->u8{a...
#1: Initial revision
## Avoid type annotations with a closure instead of a fn ### Function (24 bytes) A function requires types to be specified for its return value, and for any arguments it takes. ```rust fn f(a:u8,b:u8)->u8{a*b} ``` [Test function on Rust Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=cc81277be514fb2357174770ab0fa565) ### Closure (15 bytes) A closure does not generally require types to be specified for either its return value or any arguments it takes. ```rust let f=|a,b|a*b; ``` [Test closure on Rust Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=50791b04366d0a380af84b3b483affb4)