#017 Mar 2022iterator map filter17. filter_mapSimilar to map but if allows to drop an item.1 2 3 4 5 6 7 8 let text_nums = ["1", "two", "three", "4"]; let nums: Vec<_> = text_nums .iter() .filter_map(|x| x.parse::<u32>().ok()) .collect(); assert_eq!(nums, vec![1, 4]); show more