Skip to content

Commit 95518f6

Browse files
committed
Use if instead of match
1 parent 46092f1 commit 95518f6

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

account_manager/src/validator/import.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,13 @@ pub fn cli_run(matches: &ArgMatches, validator_dir: PathBuf) -> Result<(), Strin
169169
let password_opt = loop {
170170
if let Some(password) = previous_password.clone() {
171171
eprintln!("Reuse previous password.");
172-
match check_password_on_keystore(&keystore, &password)? {
173-
true => break Some(password),
174-
false => {
175-
eprintln!("Reused password incorrect. Retry!");
176-
if let Some(password) = get_password(stdin_inputs) {
177-
previous_password = Some(password.clone());
178-
break Some(password);
179-
}
172+
if check_password_on_keystore(&keystore, &password)? {
173+
break Some(password);
174+
} else {
175+
eprintln!("Reused password incorrect. Retry!");
176+
if let Some(password) = get_password(stdin_inputs) {
177+
previous_password = Some(password.clone());
178+
break Some(password);
180179
}
181180
}
182181
}

0 commit comments

Comments
 (0)