Created
February 14, 2019 09:38
-
-
Save hugoledoux/44fed47b35c1689d4a4b9388f338c194 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let test = vec!["one", "two", "three"]; | |
let index = test.iter().position(|&r| r.to_string() == "two").unwrap(); | |
println!("{}", index); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment