mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
remove lazy_static
This commit is contained in:
parent
ed04cc97b3
commit
fc0486dd4a
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -5779,7 +5779,7 @@ dependencies = [
|
||||
"diesel",
|
||||
"dotenv",
|
||||
"env_logger 0.9.0",
|
||||
"lazy_static",
|
||||
"once_cell",
|
||||
"r2d2",
|
||||
"rust-argon2",
|
||||
"serde",
|
||||
|
@ -12,9 +12,9 @@ derive_more = "0.99.5"
|
||||
diesel = { version = "2", features = ["postgres", "r2d2", "uuid", "chrono"] }
|
||||
dotenv = "0.15"
|
||||
env_logger = "0.9"
|
||||
once_cell = "1"
|
||||
r2d2 = "0.8"
|
||||
rust-argon2 = "1"
|
||||
lazy_static = "1.4"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
sparkpost = "0.5"
|
||||
|
@ -1,12 +1,12 @@
|
||||
use once_cell::sync::Lazy;
|
||||
use sparkpost::transmission::{
|
||||
EmailAddress, Message, Options, Recipient, Transmission, TransmissionResponse,
|
||||
};
|
||||
|
||||
use crate::{errors::ServiceError, models::Invitation};
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref API_KEY: String = std::env::var("SPARKPOST_API_KEY").expect("SPARKPOST_API_KEY must be set");
|
||||
}
|
||||
static API_KEY: Lazy<String> =
|
||||
Lazy::new(|| std::env::var("SPARKPOST_API_KEY").expect("SPARKPOST_API_KEY must be set"));
|
||||
|
||||
pub fn send_invitation(invitation: &Invitation) -> Result<(), ServiceError> {
|
||||
let tm = Transmission::new_eu(API_KEY.as_str());
|
||||
|
@ -1,10 +1,10 @@
|
||||
use argon2::{self, Config};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use crate::errors::ServiceError;
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
pub static ref SECRET_KEY: String = std::env::var("SECRET_KEY").unwrap_or_else(|_| "0123".repeat(8));
|
||||
}
|
||||
pub static SECRET_KEY: Lazy<String> =
|
||||
Lazy::new(|| std::env::var("SECRET_KEY").unwrap_or_else(|_| "0123".repeat(8)));
|
||||
|
||||
const SALT: &[u8] = b"supersecuresalt";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user