Skip to content

Instantly share code, notes, and snippets.

@saosebastiao
Created August 27, 2013 15:41
Show Gist options
  • Save saosebastiao/6355253 to your computer and use it in GitHub Desktop.
Save saosebastiao/6355253 to your computer and use it in GitHub Desktop.
fn member<T>(elem: T, vec: ~[T]) -> bool {
for vec.iter().advance |vec_elem| {
if elem == *vec_elem { return true; }
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment