Last active
January 11, 2016 21:43
-
-
Save lnds/dead88b3ecdfae8306a1 to your computer and use it in GitHub Desktop.
For con enumerate en Rust
This file contains 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
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