From 77ac084e41ecc61b1fda1763fc4bfaaa2964090c Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Mon, 25 Oct 2021 13:33:06 +0200 Subject: Fix lint --- src/args.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/args.rs b/src/args.rs index 40d34e9..6f7b1b1 100644 --- a/src/args.rs +++ b/src/args.rs @@ -186,11 +186,7 @@ fn parse_auth(src: &str) -> Result { }; let password = if let Some(hash_hex) = split.next() { - let hash_bin = if let Ok(hash_bin) = hex::decode(hash_hex) { - hash_bin - } else { - return Err(ContextualError::InvalidPasswordHash); - }; + let hash_bin = hex::decode(hash_hex).map_err(|_| ContextualError::InvalidPasswordHash)?; match second_part { "sha256" => auth::RequiredAuthPassword::Sha256(hash_bin), -- cgit v1.2.3