Hacker News new | ask | show | jobs
by seaish 1791 days ago
`.map(x => x * x)`

This isn't how you make a rust closure. It should be `.map(|x| x * x)`. Besides the mistake, it's exactly the example from the readme for rayon.

1 comments

1) Oops, thanks for pointing out the mistake. Will fix in a few minutes. 2) The freaky thing is, I'm fairly sure I didn't even see or look at Rayon's official example in README when I came up with that example for my crate I only came up with it because I was _just_ working on root mean square errors in another side-project. That's hell of a coincidence.