#fun #iterator #collection #prime #tinker

yanked funtools

a collection of fun iterators to tinker with

0.2.0 Jul 5, 2021
0.1.1 Jul 5, 2021
0.1.0 Jun 27, 2021

#123 in #prime

GPL-2.0 license

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.

No runtime deps