trpl-zh-cn/listings/ch13-functional-features/listing-13-03/src/main.rs

9 lines
176 B
Rust

fn main() {
// ANCHOR: here
let example_closure = |x| x;
let s = example_closure(String::from("hello"));
let n = example_closure(5);
// ANCHOR_END: here
}