9 lines
178 B
Rust
9 lines
178 B
Rust
fn main() {
|
|
let haystack = vec![1, 2, 3];
|
|
|
|
let contains = move |needle| haystack.contains(needle);
|
|
|
|
println!("{}", contains(&1));
|
|
println!("{}", contains(&4));
|
|
}
|