aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorboastful-squirrel <boastful.squirrel@gmail.com>2019-05-06 16:56:32 +0000
committerboastful-squirrel <boastful.squirrel@gmail.com>2019-05-06 16:56:32 +0000
commit26ae6d973468eb80a71199d80c0db210e6883968 (patch)
treea73d135bdd3e5bb8725fdcefa1385754939e691a /src
parentUndo changes on InvalidHashMethod error (diff)
downloadminiserve-26ae6d973468eb80a71199d80c0db210e6883968.tar.gz
miniserve-26ae6d973468eb80a71199d80c0db210e6883968.zip
Undo changes on args.rs
Diffstat (limited to 'src')
-rw-r--r--src/args.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/args.rs b/src/args.rs
index ea0a4ac..d291bb9 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -3,7 +3,7 @@ use std::path::PathBuf;
use structopt::StructOpt;
use crate::auth;
-use crate::errors::ContextualError;
+use crate::errors::{ContextualError};
use crate::themes;
/// Possible characters for random routes
@@ -99,13 +99,15 @@ fn parse_auth(src: &str) -> Result<auth::RequiredAuth, ContextualError> {
let hash_bin = if let Ok(hash_bin) = hex::decode(hash_hex) {
hash_bin
} else {
- return Err(ContextualError::InvalidPasswordHash);
+ return Err(ContextualError::InvalidPasswordHash)
};
match second_part {
"sha256" => auth::RequiredAuthPassword::Sha256(hash_bin.to_owned()),
"sha512" => auth::RequiredAuthPassword::Sha512(hash_bin.to_owned()),
- _ => return Err(ContextualError::InvalidHashMethod(second_part.to_owned())),
+ _ => {
+ return Err(ContextualError::InvalidHashMethod(second_part.to_owned()))
+ },
}
} else {
// To make it Windows-compatible, the password needs to be shorter than 255 characters.