aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/args.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/args.rs b/src/args.rs
index 97b391f..4077f35 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -97,9 +97,10 @@ fn parse_auth(src: &str) -> Result<auth::RequiredAuth, ContextualError> {
};
let password = if let Some(hash_hex) = split.next() {
- let hash_bin = match hex::decode(hash_hex) {
- Ok(hash_bin) => hash_bin,
- _ => return Err(ContextualError::new(ContextualErrorKind::InvalidPasswordHash)),
+ let hash_bin = if let Ok(hash_bin) = hex::decode(hash_hex) {
+ hash_bin
+ } else {
+ return Err(ContextualError::new(ContextualErrorKind::InvalidPasswordHash))
};
match second_part {