Skip to content

Instantly share code, notes, and snippets.

@lnds
Last active January 11, 2016 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lnds/dead88b3ecdfae8306a1 to your computer and use it in GitHub Desktop.
Save lnds/dead88b3ecdfae8306a1 to your computer and use it in GitHub Desktop.
For con enumerate en Rust
for (i,c) in accion.chars().enumerate() {
if !c.is_digit(10) { return Error }
else if i >= tam { return Error }
else {
let digito = c.to_digit(10).unwrap();
if num.contains(&digito) { return Error }
num.push(digito)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment