diff options
author | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-04-27 10:31:14 +0000 |
---|---|---|
committer | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-04-27 10:31:14 +0000 |
commit | c2ce5295eb27610734ed539d47979c7bc0f0953b (patch) | |
tree | 67da1794984a99d1dd18cf29f88f0c8142686dec | |
parent | Improved some errors (diff) | |
download | miniserve-c2ce5295eb27610734ed539d47979c7bc0f0953b.tar.gz miniserve-c2ce5295eb27610734ed539d47979c7bc0f0953b.zip |
Fixed test + fixed clippy warning
-rw-r--r-- | src/args.rs | 2 | ||||
-rw-r--r-- | src/auth.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/args.rs b/src/args.rs index b769a9b..9ccb7a6 100644 --- a/src/args.rs +++ b/src/args.rs @@ -214,7 +214,7 @@ mod tests { ), case( "username:blahblah:abcd", - "blahblah is not a valid hashing method. Expected sha256 or sha512" + "Invalid hashing method blahblah. Expected sha256 or sha512" ), case( "username:sha256:invalid", diff --git a/src/auth.rs b/src/auth.rs index d8de30e..a42bb53 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -75,8 +75,8 @@ pub fn match_auth(basic_auth: BasicAuthParams, required_auth: &RequiredAuth) -> } /// Return `true` if hashing of `password` by `T` algorithm equals to `hash` -pub fn compare_hash<T: Digest>(password: String, hash: &Vec<u8>) -> bool { - get_hash::<T>(password) == *hash +pub fn compare_hash<T: Digest>(password: String, hash: &[u8]) -> bool { + get_hash::<T>(password) == hash } /// Get hash of a `text` |