diff --git a/Cargo.toml b/Cargo.toml index 66240b9..5e7d5d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,6 +47,7 @@ full = [ "time-ago", "get-place-by-iran-national-id", "half-space", + "legal-id" ] add-ordinal-suffix = [] commas = [] @@ -66,6 +67,7 @@ extract-card-number = [] time-ago = ["dep:thiserror", "dep:chrono"] get-place-by-iran-national-id = ["dep:thiserror"] half-space = [] +legal-id= ["dep:thiserror"] [package.metadata.docs.rs] all-features = true diff --git a/Makefile b/Makefile index dee6f1d..ca65c42 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ fmt: cargo fmt -build: full default add-ordinal-suffix commas digits find-capital-by-province persian-chars national-id remove-ordinal-suffix url-fix verity-card-number time-ago phone-number bill number-to-words get-bank-name-by-card-number extract-card-number get-place-by-iran-national-id half-space +build: full default add-ordinal-suffix commas digits find-capital-by-province persian-chars national-id remove-ordinal-suffix url-fix verity-card-number time-ago phone-number bill number-to-words get-bank-name-by-card-number extract-card-number get-place-by-iran-national-id half-space legal-id check: clippy lint @@ -121,4 +121,9 @@ get-place-by-iran-national-id: half-space: @ echo "" cargo build --no-default-features --features=half-space + @ ls -sh target/debug/*.rlib + +legal-id: + @ echo "" + cargo build --no-default-features --features=legal-id @ ls -sh target/debug/*.rlib \ No newline at end of file diff --git a/README.md b/README.md index 63fe6ae..f7c1a47 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,10 @@ Rust version of Persian Tools - [x] findCapitalByProvince - [x] getBankNameByCardNumber - [x] getPlaceByIranNationalId -- [ ] halfSpace +- [x] halfSpace - [ ] isArabic - [x] isPersian -- [ ] legalId +- [-] legalId - [x] nationalId - [x] numberToWords - [ ] numberplate diff --git a/src/legal_id/mod.rs b/src/legal_id/mod.rs new file mode 100644 index 0000000..f7740ac --- /dev/null +++ b/src/legal_id/mod.rs @@ -0,0 +1,21 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum VerifyIranianLegalIdError { + #[error("invalid legal id")] + NotValid, +} + +pub fn verifyIranianLegalId(inp: impl AsRef) -> Result<(), VerifyIranianLegalIdError> { + Ok(()) +} + +#[cfg(test)] +mod tests { + // use super::*; + + #[test] + fn test_name() { + assert_eq!(1, 1); + } +} diff --git a/src/lib.rs b/src/lib.rs index a009641..7a0fef7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,6 +16,7 @@ feature = "time-ago", feature = "get-place-by-iran-national-id", feature = "half-space", + feature = "legal-id", )))] compile_error!("No available Cargo feature is included"); @@ -69,3 +70,6 @@ pub mod get_place_by_iran_national_id; #[cfg(feature = "half-space")] pub mod half_space; + +#[cfg(feature = "legal-id")] +pub mod legal_id;