Hi everyone!

I have about almost two decades of experience in other programming languages but am pretty new to Rust. I love it so far and am almost done with the official book. I wanted to start tinkering with WebAssembly, so I figured I'd do a simple, silly CPU bound brute-force test in both Rust and JavaScript (implemented nearly identically) to see any performance differences. But before I went down the browser path, I figured I would just do a simple cli version of both first.

The program below is just a simple iterative discovery of the first N prime numbers (`num_primes`

below) using a naive algorithm testing divisibility of prior primes. When I timed the executions though, the Node version came out to be about 2x as fast as the release built Rust version. I would have expected similar performance, if not Rust winning. Clearly, I'm doing something wrong with the Rust version, and hope you can spot it for me. And I know all the caveats about benchmarking trivial programs like this, but I'm generally curious what's up in this case.

```
use std::env;
fn main() {
let args: Vec<String> = env::args().collect();
let num_primes = args.get(1).unwrap().parse::<usize>().unwrap();
let mut primes: Vec<i64> = Vec::with_capacity(num_primes);
let mut n: i64 = 2;
while primes.len() < num_primes {
if let None = primes.iter().find(|&&p| n % p == 0) {
primes.push(n);
}
n += 1;
}
println!("Found {} primes, and the last is = {}", primes.len(), n - 1);
}
```

Full info code/terminal output here: https://gist.github.com/shayneczyzewski/37608fa7bd1c1645fcefb50c35d8ea62

I'm guessing there are plenty of idiomatic Rust improvements, which I would love to hear (like maybe using `Iterator::any`

instead of `find`

), but specifically any that may be impacting performance would be appreciated!

Thanks!

Shayne