Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate rayon; // 1.0.2
- use rayon::prelude::*;
- fn main() {
- let numbers: Vec<_> = "12.03 0.3 44.2 45 zzz".split_whitespace().collect();
- let x = numbers
- .par_iter()
- .map(|n| n.parse::<f32>())
- .filter_map(|n| n.ok());
- x.for_each(|n| println!("{:?}", n));
- }
Add Comment
Please, Sign In to add comment