SHARE
TWEET

Untitled

a guest Aug 18th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn gen_primes() -> impl Iterator<Item = u32> {
  2.     fn is_prime(x: &u32) -> bool { // note: `&u32` is not idiomatic, but makes things cleaner below. Good enough for a POC :)
  3.         false
  4.     }
  5.     (2..).filter(is_prime)
  6. }
  7.  
  8. fn main() {
  9.     println!(
  10.         "{:?}",
  11.         gen_primes().take_while(|x| *x < 50).collect::<Vec<_>>()
  12.     );
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top