0.2.0 |
|
---|---|
0.1.1 |
|
0.1.0 |
|
#124 in #prime
6KB
144 lines
funtools
funtools
contain a collection of fun iterators to tinker with.
For examples, see the tests directory.
use funtools::Prime;
let first_hundred = vec![2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97];
let primes = Prime::new().take_while(|x| x < &100).collect::<Vec<_>>();
assert_eq!(first_hundred, primes);
use funtools::Prime;
let valid = Some(9973);
let prime = Prime::new().take_while(|x| x < &10000).last();
assert_eq!(valid, prime);
lib.rs
:
funtools
contain a collection of fun iterators to tinker with.
For examples, see the tests directory.