Guest User

Untitled

a guest
Jul 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. extern crate rayon; // 1.0.2
  2.  
  3. use rayon::prelude::*;
  4.  
  5. fn main() {
  6. let numbers: Vec<_> = "12.03 0.3 44.2 45 zzz".split_whitespace().collect();
  7.  
  8. let x = numbers
  9. .par_iter()
  10. .map(|n| n.parse::<f32>())
  11. .filter_map(|n| n.ok());
  12.  
  13. x.for_each(|n| println!("{:?}", n));
  14. }
Add Comment
Please, Sign In to add comment