1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

chore: update rand to 0.9

This commit is contained in:
Rob Ede
2025-02-24 03:28:04 +00:00
parent b12952f5cb
commit ad0c1b765e
4 changed files with 170 additions and 106 deletions

View File

@ -4,7 +4,7 @@ use std::time::Duration;
use apalis::prelude::*;
use apalis_redis::{Config, RedisStorage};
use rand::distributions::{Alphanumeric, DistString as _};
use rand::distr::{Alphanumeric, SampleString as _};
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize)]
@ -14,7 +14,7 @@ pub(crate) struct Email {
impl Email {
pub(crate) fn random() -> Self {
let user = Alphanumeric.sample_string(&mut rand::thread_rng(), 10);
let user = Alphanumeric.sample_string(&mut rand::rng(), 10);
let to = format!("{user}@fake-mail.com");
Self { to }
}