diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2019-05-10 18:17:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 18:17:55 +0000 |
commit | 1b92ddb24ec9d364d8170912e047317eef726c7d (patch) | |
tree | c2ccd3786cb68b123bf90190b9d9c47ec34b9559 /src/args.rs | |
parent | Merge pull request #90 from boastful-squirrel/themed-errors (diff) | |
parent | Fix clippy (diff) | |
download | miniserve-1b92ddb24ec9d364d8170912e047317eef726c7d.tar.gz miniserve-1b92ddb24ec9d364d8170912e047317eef726c7d.zip |
Merge pull request #112 from boastful-squirrel/fix-clippy
Fix Clippy warnings + cargo fmt
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/args.rs b/src/args.rs index d291bb9..ea0a4ac 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,15 +99,13 @@ 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. |