diff options
Diffstat (limited to 'src/auth.rs')
-rw-r--r-- | src/auth.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/auth.rs b/src/auth.rs index c7d0b78..92157c9 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -114,7 +114,7 @@ mod tests { fn test_get_hash(password: &str, hash_method: &str, hash: &str) { let hash_func = get_hash_func(hash_method); let expected = hex::decode(hash).expect("Provided hash is not a valid hex code"); - let received = hash_func(&password.to_owned()); + let received = hash_func(password); assert_eq!(received, expected); } @@ -124,8 +124,8 @@ mod tests { let password = match encrypt { "plain" => Plain(password.to_owned()), - "sha256" => Sha256(get_hash::<sha2::Sha256>(&password.to_owned())), - "sha512" => Sha512(get_hash::<sha2::Sha512>(&password.to_owned())), + "sha256" => Sha256(get_hash::<sha2::Sha256>(password)), + "sha512" => Sha512(get_hash::<sha2::Sha512>(password)), _ => panic!("Unknown encryption type"), }; |