#014 Apr 20, 2022iterator position14. Find index of itemUse position to find position of an element in iterator. Returns None if the element does not exist.1 2 3 4 5 6 let nums = [1, 2, 3]; let pos = nums.iter().position(|value| *value == 3); assert_eq!(pos, Some(2)); let pos = nums.iter().position(|value| *value == 10); assert_eq!(pos, None); This post is licensed under CC BY 4.0 by the author.Share: ← Previous 15. Scan Next → 16. Option/Result match?!