From 8eb5be96b395b8304aca4f598f3f275802841e49 Mon Sep 17 00:00:00 2001 From: StNicolay Date: Tue, 6 Aug 2024 16:44:49 +0300 Subject: [PATCH] Small change --- src/auth.rs | 2 +- src/errors.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 89133a1..9922f1f 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -65,7 +65,7 @@ impl HashedBytes { /// Hashes the bytes #[must_use] pub fn hash_bytes(bytes: &[u8]) -> Self { - let mut salt = [0; 64]; + let mut salt = [0; SALT_LENGTH]; OsRng.fill_bytes(&mut salt); Self { hash: hash_scrypt(bytes, &salt), diff --git a/src/errors.rs b/src/errors.rs index 023554b..b82bb46 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -92,9 +92,10 @@ pub trait ItemNotFoundExt { impl ItemNotFoundExt for Option { fn item_not_found(self) -> GeneralResult { - const ITEM_NOT_FOUND_ERROR: GeneralError = - GeneralError::const_message(StatusCode::NOT_FOUND, "Item not found"); - self.ok_or(ITEM_NOT_FOUND_ERROR) + self.ok_or(GeneralError::const_message( + StatusCode::NOT_FOUND, + "Item not found", + )) } }