mirror of
https://github.com/actix/examples
synced 2025-06-27 01:27:43 +02:00
remove lazy_static
This commit is contained in:
@ -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";
|
||||
|
||||
|
Reference in New Issue
Block a user