add closure
This commit is contained in:
7
single_file_tests/closure.rs
Normal file
7
single_file_tests/closure.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
fn main() {
|
||||
let add = | a: i32, b: i32 | -> i32 { a + b };
|
||||
|
||||
println!("{}", add(1, 10));
|
||||
println!("{}", (|| 10 + 100)());
|
||||
}
|
||||
Reference in New Issue
Block a user