chore: refactor deprecated fn call
This commit is contained in:
parent
e5d9eca47f
commit
bc02946bd5
1 changed files with 2 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ use fake::Fake;
|
||||||
use rand::seq::IndexedRandom;
|
use rand::seq::IndexedRandom;
|
||||||
use sqlx::PgPool;
|
use sqlx::PgPool;
|
||||||
use tokio::time::{sleep, Duration};
|
use tokio::time::{sleep, Duration};
|
||||||
use rand::thread_rng;
|
use rand::rng;
|
||||||
|
|
||||||
pub async fn generate_data(pool: &PgPool) -> Result<(), sqlx::Error> {
|
pub async fn generate_data(pool: &PgPool) -> Result<(), sqlx::Error> {
|
||||||
let pizza_types = vec!["Margherita", "Pepperoni", "Hawaiian", "Veggie", "BBQ Chicken"];
|
let pizza_types = vec!["Margherita", "Pepperoni", "Hawaiian", "Veggie", "BBQ Chicken"];
|
||||||
|
|
@ -31,7 +31,7 @@ pub async fn generate_data(pool: &PgPool) -> Result<(), sqlx::Error> {
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if let Some((customer_id,)) = customer_opt {
|
if let Some((customer_id,)) = customer_opt {
|
||||||
let mut rng = thread_rng();
|
let mut rng = rng();
|
||||||
if let Some(pizza_type) = pizza_types.choose(&mut rng) {
|
if let Some(pizza_type) = pizza_types.choose(&mut rng) {
|
||||||
let quantity = 1;
|
let quantity = 1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue