```
mod np {
pub fn nth(n: u32) -> u32 {
let mut found_primes: Vec<u32> = vec![];
let mut number = 2;
while found_primes.len() <= n as usize {
if is_prime(number) {
found_primes.push(number)
}
number = number + 1
}
return number;
}
pub fn is_prime(n: u32) -> bool {
let upper_bound = (n as f32).sqrt().ceil() as u32;
for x in 1..=upper_bound {
if n % x == 0 {
return false;
}
}
return true;
}
}
#[test]
fn test_first_prime() {
assert_eq!(np::nth(0), 2);
}
#[test]
fn test_second_prime() {
assert_eq!(np::nth(1), 3);
}
```

(Playground)

```
test test_sixth_prime ... ignored
test test_first_prime ... test test_first_prime has been running for over 60 seconds
test test_first_prime ... FAILED
failures:
---- test_first_prime stdout ----
thread 'test_first_prime' panicked at 'attempt to add with overflow', src\lib.rs:10:18
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failures:
test_first_prime
```