Updated to Rust 1.80 and changed to LazyLock

This commit is contained in:
StNicolay 2024-07-25 17:45:36 +03:00
parent 4121857854
commit 5c789533e3
Signed by: StNicolay
GPG Key ID: 9693D04DCD962B0D
4 changed files with 6 additions and 11 deletions

8
Cargo.lock generated
View File

@ -1078,9 +1078,9 @@ dependencies = [
[[package]]
name = "object"
version = "0.36.1"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
dependencies = [
"memchr",
]
@ -1090,9 +1090,6 @@ name = "once_cell"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
dependencies = [
"parking_lot_core",
]
[[package]]
name = "opaque-debug"
@ -1150,7 +1147,6 @@ dependencies = [
"futures",
"hex",
"itertools 0.13.0",
"once_cell",
"parking_lot",
"pbkdf2",
"rand",

View File

@ -29,7 +29,6 @@ dotenvy = "0.15"
futures = "0.3"
hex = "0.4"
itertools = "0.13"
once_cell = { version = "1", features = ["parking_lot"] }
parking_lot = "0.12"
pbkdf2 = { version = "0.12", features = ["parallel"] }
rand = { version = "0.8", default-features = false, features = [

View File

@ -107,10 +107,10 @@ impl Decrypted {
#[cfg(test)]
mod tests {
use super::*;
use once_cell::sync::Lazy;
use std::sync::LazyLock;
const TESTING_MASTER_PASSWORD: &str = "VeryStr^n#M@$terP@$$!word";
static CIPHER: Lazy<Cipher> = Lazy::new(|| {
static CIPHER: LazyLock<Cipher> = LazyLock::new(|| {
let mut salt = [0; 64];
OsRng.fill_bytes(&mut salt);

View File

@ -1,13 +1,13 @@
use crate::entity::master_pass::MasterPass;
use once_cell::sync::Lazy;
use rand::{rngs::OsRng, RngCore};
use scrypt::{scrypt, Params};
use std::sync::LazyLock;
use subtle::ConstantTimeEq;
pub const HASH_LENGTH: usize = 64;
pub const SALT_LENGTH: usize = 64;
static PARAMS: Lazy<Params> = Lazy::new(|| Params::new(14, 8, 1, HASH_LENGTH).unwrap());
static PARAMS: LazyLock<Params> = LazyLock::new(|| Params::new(14, 8, 1, HASH_LENGTH).unwrap());
/// Hashes the bytes with Scrypt with the given salt
#[must_use]