Small change

This commit is contained in:
StNicolay 2024-08-06 16:44:49 +03:00
parent 2b12996453
commit 8eb5be96b3
Signed by: StNicolay
GPG Key ID: 9693D04DCD962B0D
2 changed files with 5 additions and 4 deletions

View File

@ -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),

View File

@ -92,9 +92,10 @@ pub trait ItemNotFoundExt<T> {
impl<T> ItemNotFoundExt<T> for Option<T> {
fn item_not_found(self) -> GeneralResult<T> {
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",
))
}
}