rlibphonenumber 1.1.3

A high-performance Rust port of Google's libphonenumber for parsing, formatting, and validating international phone numbers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::PHONE_NUMBER_UTIL;

#[test]
fn is_valid_number_mismatch() {
    let cases = [("CD(+48X666666644", "", true)];

    cases
        .iter()
        .for_each(|(phone, country_code, should_valid)| {
            assert_eq!(
                PHONE_NUMBER_UTIL
                    .parse_with_default_region(phone, country_code)
                    .unwrap()
                    .is_valid(),
                *should_valid
            )
        });
}