Skip to content

Commit

Permalink
open pr: legal_id
Browse files Browse the repository at this point in the history
  • Loading branch information
ali77gh committed Jan 13, 2024
1 parent 9bcd5dc commit bc18973
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ full = [
"time-ago",
"get-place-by-iran-national-id",
"half-space",
"legal-id"
]
add-ordinal-suffix = []
commas = []
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions src/legal_id/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use thiserror::Error;

#[derive(Error, Debug)]
pub enum VerifyIranianLegalIdError {
#[error("invalid legal id")]
NotValid,
}

pub fn verifyIranianLegalId(inp: impl AsRef<str>) -> Result<(), VerifyIranianLegalIdError> {
Ok(())
}

#[cfg(test)]
mod tests {
// use super::*;

#[test]
fn test_name() {
assert_eq!(1, 1);
}
}
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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;

0 comments on commit bc18973

Please sign in to comment.