Sanitaze code
This commit is contained in:
@@ -13,19 +13,3 @@ impl<'a> PhoneNumberWithCountryCodeSource<'a> {
|
||||
Self { phone_number, country_code_source }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PhoneNumberAndCarrierCode<'a> {
|
||||
pub carrier_code: Option<&'a str>,
|
||||
pub phone_number: Cow<'a, str>
|
||||
}
|
||||
|
||||
impl<'a> PhoneNumberAndCarrierCode<'a> {
|
||||
pub fn new<B: Into<Cow<'a, str>>>(carrier_code: Option<&'a str>, phone_number: B) -> Self {
|
||||
Self { carrier_code, phone_number: phone_number.into() }
|
||||
}
|
||||
|
||||
pub fn new_phone<B: Into<Cow<'a, str>>>(phone_number: B) -> Self {
|
||||
Self { carrier_code: None, phone_number: phone_number.into() }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ use crate::{phonenumberutil::{helper_constants::{
|
||||
VALID_PUNCTUATION
|
||||
}, helper_functions::create_extn_pattern}, regexp_cache::RegexCache};
|
||||
|
||||
#[allow(unused)]
|
||||
pub(super) struct PhoneNumberRegExpsAndMappings {
|
||||
/// Regular expression of viable phone numbers. This is location independent.
|
||||
/// Checks we have at least three leading digits, and only valid punctuation,
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
cmp::max,
|
||||
collections::{HashMap, HashSet, VecDeque},
|
||||
sync::Arc,
|
||||
};
|
||||
@@ -36,7 +35,7 @@ use crate::{
|
||||
is_national_number_suffix_of_the_other, load_compiled_metadata, normalize_helper,
|
||||
prefix_number_with_country_calling_code, test_number_length,
|
||||
test_number_length_with_unknown_type,
|
||||
}, helper_types::{PhoneNumberAndCarrierCode, PhoneNumberWithCountryCodeSource}, MatchType, PhoneNumberFormat, PhoneNumberType, ValidNumberLenType
|
||||
}, helper_types::{PhoneNumberWithCountryCodeSource}, MatchType, PhoneNumberFormat, PhoneNumberType, ValidNumberLenType
|
||||
},
|
||||
phonemetadata::{NumberFormat, PhoneMetadata, PhoneNumberDesc},
|
||||
phonenumber::{phone_number::CountryCodeSource, PhoneNumber},
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
mod tests;
|
||||
#[cfg(test)]
|
||||
mod phonenumberutil_tests;
|
||||
pub(self) mod region_code;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
pub struct RegionCode {}
|
||||
|
||||
#[allow(unused)]
|
||||
impl RegionCode {
|
||||
pub fn ad() -> &'static str {
|
||||
"AD"
|
||||
|
||||
Reference in New Issue
Block a user