From c2ce5295eb27610734ed539d47979c7bc0f0953b Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Sat, 27 Apr 2019 12:31:14 +0200 Subject: Fixed test + fixed clippy warning --- src/args.rs | 2 +- src/auth.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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(password: String, hash: &Vec) -> bool { - get_hash::(password) == *hash +pub fn compare_hash(password: String, hash: &[u8]) -> bool { + get_hash::(password) == hash } /// Get hash of a `text` -- cgit v1.2.3