build(deps): migrate usages of once_cell crate to standard library equivalents (#8030)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sanchith Hegde
2025-05-19 15:54:03 +05:30
committed by GitHub
parent da90d74bfa
commit 673cf249b0
32 changed files with 176 additions and 183 deletions

View File

@ -1,10 +1,9 @@
//! Custom validations for some shared types.
use std::collections::HashSet;
use std::{collections::HashSet, sync::LazyLock};
use error_stack::report;
use globset::Glob;
use once_cell::sync::Lazy;
use regex::Regex;
#[cfg(feature = "logs")]
use router_env::logger;
@ -25,7 +24,7 @@ pub fn validate_phone_number(phone_number: &str) -> Result<(), ValidationError>
/// Performs a simple validation against a provided email address.
pub fn validate_email(email: &str) -> CustomResult<(), ValidationError> {
#[deny(clippy::invalid_regex)]
static EMAIL_REGEX: Lazy<Option<Regex>> = Lazy::new(|| {
static EMAIL_REGEX: LazyLock<Option<Regex>> = LazyLock::new(|| {
#[allow(unknown_lints)]
#[allow(clippy::manual_ok_err)]
match Regex::new(