Small change
This commit is contained in:
parent
2b12996453
commit
8eb5be96b3
@ -65,7 +65,7 @@ impl HashedBytes {
|
|||||||
/// Hashes the bytes
|
/// Hashes the bytes
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn hash_bytes(bytes: &[u8]) -> Self {
|
pub fn hash_bytes(bytes: &[u8]) -> Self {
|
||||||
let mut salt = [0; 64];
|
let mut salt = [0; SALT_LENGTH];
|
||||||
OsRng.fill_bytes(&mut salt);
|
OsRng.fill_bytes(&mut salt);
|
||||||
Self {
|
Self {
|
||||||
hash: hash_scrypt(bytes, &salt),
|
hash: hash_scrypt(bytes, &salt),
|
||||||
|
@ -92,9 +92,10 @@ pub trait ItemNotFoundExt<T> {
|
|||||||
|
|
||||||
impl<T> ItemNotFoundExt<T> for Option<T> {
|
impl<T> ItemNotFoundExt<T> for Option<T> {
|
||||||
fn item_not_found(self) -> GeneralResult<T> {
|
fn item_not_found(self) -> GeneralResult<T> {
|
||||||
const ITEM_NOT_FOUND_ERROR: GeneralError =
|
self.ok_or(GeneralError::const_message(
|
||||||
GeneralError::const_message(StatusCode::NOT_FOUND, "Item not found");
|
StatusCode::NOT_FOUND,
|
||||||
self.ok_or(ITEM_NOT_FOUND_ERROR)
|
"Item not found",
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user