mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 20:23:43 +08:00
chore: address Rust 1.86.0 clippy lints (#7735)
This commit is contained in:
@ -125,7 +125,7 @@ impl<const PRECISION: u8> Percentage<PRECISION> {
|
||||
fn is_valid_precision_length(value: &str) -> bool {
|
||||
if value.contains('.') {
|
||||
// if string has '.' then take the decimal part and verify precision length
|
||||
match value.split('.').last() {
|
||||
match value.split('.').next_back() {
|
||||
Some(decimal_part) => {
|
||||
decimal_part.trim_end_matches('0').len() <= <u8 as Into<usize>>::into(PRECISION)
|
||||
}
|
||||
|
||||
@ -26,6 +26,8 @@ pub fn validate_phone_number(phone_number: &str) -> Result<(), ValidationError>
|
||||
pub fn validate_email(email: &str) -> CustomResult<(), ValidationError> {
|
||||
#[deny(clippy::invalid_regex)]
|
||||
static EMAIL_REGEX: Lazy<Option<Regex>> = Lazy::new(|| {
|
||||
#[allow(unknown_lints)]
|
||||
#[allow(clippy::manual_ok_err)]
|
||||
match Regex::new(
|
||||
r"^(?i)[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$",
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user