Skip to content

Commit

Permalink
ref: phone number
Browse files Browse the repository at this point in the history
* Use statics
* Add structs & enums methods
* Make enums copyable
* modify test & docs
  • Loading branch information
pouriya committed Dec 9, 2023
1 parent 2809c02 commit b2f57b8
Show file tree
Hide file tree
Showing 2 changed files with 345 additions and 199 deletions.
4 changes: 2 additions & 2 deletions src/phone_number/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pub mod operators;

use regex::Regex;

const MOBILE_REGEX: &str = r#"^(\+98|98|0098|0)?9(\d{2})\d{7}$"#;
pub const PREFIXES: [&str; 4] = ["+98", "98", "0098", "0"];
static MOBILE_REGEX: &str = r#"^(\+98|98|0098|0)?9(\d{2})\d{7}$"#;
pub static PREFIXES: [&str; 4] = ["+98", "98", "0098", "0"];

/// This is a simple function that checks if a phone number valid or not
///
Expand Down
Loading

0 comments on commit b2f57b8

Please sign in to comment.