4 releases (stable)

1.0.2 Jul 8, 2023
1.0.1 Feb 6, 2023
1.0.0 Feb 5, 2023
0.9.0 Feb 5, 2023

#949 in Rust patterns

MIT license

16KB
344 lines

rust 中一些常用工具

linter Status tests Status doc.rs crates.io

安装

[dependencies]
yansongda-utils = { version = "~1.0.0", features = ["phone"] }

文档

点击传送

使用

Phone 模块

use yansongda_utils::phone;

// 是否是手机号码
assert!(phone::is_mobile("13800138000"));
// 是否是固定电话
assert!(phone::is_telephone("01012345678"));
// 是否是服务号码
assert!(phone::is_service("12345678"));
// 是否是长途
assert!(phone::is_idd("0012345678"));

lib.rs:

关于自己的常用的一些工具函数

Features

默认情况下,所有功能都是禁用的,需要单独制定相关 feature 来启用。

macros

一些有用的宏

phone

电话号码相关的工具函数

Dependencies

~0–1MB
~16K SLoC