I am new to Rust and I wanted to write something that finds the first 100 primes. This is my code. I am sure there is a more idiomatic way to write this in Rust. Any help appreciated.

```
// primes.rs
fn next_p(divs: &[u64], cand: &u64) -> Option<u64> {
let root = (*cand as f64).sqrt();
for d in divs {
if *d as f64 > root {
return Some(*cand);
}
if cand % d == 0 {
return None;
}
}
None
}
fn main () {
println!("*** Eratosthenes' Sieve ***");
// Declare a vector to hold 100 primes.
let mut divs:Vec<u64> = Vec::with_capacity(100);
// Start it off with 2.
divs.push(2);
// First candidate is 3.
let mut cand = 3u64;
// Loop until the vector is full.
while divs.len() < 100 {
match next_p(divs.as_slice(), &cand) {
Some(p) => divs.push(p),
None => (),
}
cand += 2;
}
println!("{:?}", divs);
}
```