diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-03-14 12:41:49 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-03-14 12:41:49 +0100 |
commit | fcbc8709c44b9e295fc702035861de90ea593ef6 (patch) | |
tree | f093b7343c28d23da9fc9c3c3c35dd607e70855f /src | |
parent | 1ce10e19a2b07322e49f885efc4115e0ded8f459 (diff) | |
download | checkpw-fcbc8709c44b9e295fc702035861de90ea593ef6.tar.gz checkpw-fcbc8709c44b9e295fc702035861de90ea593ef6.tar.bz2 checkpw-fcbc8709c44b9e295fc702035861de90ea593ef6.zip |
Split main loop, first parse args then check passwords.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index ffe811e..9450068 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,10 +111,12 @@ fn check(pw: Password) -> Result<(), Box<::std::error::Error>> { } fn main() { + let mut passwords = Vec::new(); for arg in env::args().skip(1) { - let pw = Password::new(&arg); - println!("{}:{}:{}:", &arg, pw.range, pw.rest); + passwords.push(Password::new(&arg)); + }; + for pw in passwords { check(pw).unwrap(); - }; + } } |