Hacker News new | past | comments | ask | show | jobs | submit login

For the record:

    let squares: Vec<_> = numbers.iter().filter(x => x >= 0).map(x => x * x).collect();
is not valid Rust, but this is:

    let squares: Vec<_> = numbers.iter().filter(|&&x| x >= 0).map(|x| x * x).collect();



The above seems more like valid TypeScript instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: