aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2021-10-25 11:33:06 +0000
committerSven-Hendrik Haase <svenstaro@gmail.com>2021-10-25 11:33:06 +0000
commit77ac084e41ecc61b1fda1763fc4bfaaa2964090c (patch)
tree878f968d218db201b22bb439507b78eddc9da4dc /src
parentAdd CHANGELOG entry for SPA mode (diff)
downloadminiserve-77ac084e41ecc61b1fda1763fc4bfaaa2964090c.tar.gz
miniserve-77ac084e41ecc61b1fda1763fc4bfaaa2964090c.zip
Fix lint
Diffstat (limited to '')
-rw-r--r--src/args.rs6
1 files changed, 1 insertions, 5 deletions
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<auth::RequiredAuth, ContextualError> {
};
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),