mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-30 15:15:01 +00:00
chore: replace once_cell OnceCell/Lazy with std OnceLock/LazyLock (#3709)
This commit is contained in:
@@ -24,7 +24,6 @@ validator = { version = "0.16.0", features = ["derive"] }
|
||||
# Auxilliary crates
|
||||
anyhow = "1.0.58"
|
||||
dotenvy = "0.15.1"
|
||||
once_cell = "1.13.0"
|
||||
thiserror = "2.0.0"
|
||||
tracing = "0.1.35"
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
use axum::http::StatusCode;
|
||||
use axum::{routing::post, Extension, Json, Router};
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::Rng;
|
||||
use regex::Regex;
|
||||
use std::time::Duration;
|
||||
use std::{sync::LazyLock, time::Duration};
|
||||
|
||||
use serde::Deserialize;
|
||||
use sqlx::{PgExecutor, PgPool};
|
||||
@@ -18,7 +17,7 @@ pub fn router() -> Router {
|
||||
Router::new().route("/v1/user", post(create_user))
|
||||
}
|
||||
|
||||
static USERNAME_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"^[0-9A-Za-z_]+$").unwrap());
|
||||
static USERNAME_REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"^[0-9A-Za-z_]+$").unwrap());
|
||||
|
||||
// CREATE USER
|
||||
|
||||
|
||||
Reference in New Issue
Block a user