Skip to content

Instantly share code, notes, and snippets.

@leopard627
Last active January 13, 2019 15:44
Show Gist options
  • Save leopard627/f2883df7735504b4506f6582eeaf05b9 to your computer and use it in GitHub Desktop.
Save leopard627/f2883df7735504b4506f6582eeaf05b9 to your computer and use it in GitHub Desktop.
search worlds
fn search_foo(s: &String, word: &'static str) -> &'static str {
for (i, item) in s.chars().enumerate() {
if &s[i..i+3] == word {
return word
}
}
""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment