Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge time_ago & remaining_time to new time_diff module #53

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ full = [
"number-to-words",
"get-bank-name-by-card-number",
"extract-card-number",
"time-ago",
"time-diff",
"get-place-by-iran-national-id",
"half-space",
"legal-id",
"words-to-number",
"sheba",
"remaining-time",
] # For now, by default we enable all features:


Expand All @@ -71,13 +70,12 @@ bill = ["dep:num", "dep:num-derive", "dep:num-traits", "dep:thiserror"]
number-to-words = ["dep:thiserror", "commas"]
get-bank-name-by-card-number = ["dep:thiserror"]
extract-card-number = []
time-ago = ["dep:thiserror", "dep:chrono"]
time-diff = ["dep:thiserror", "dep:chrono"]
get-place-by-iran-national-id = ["dep:thiserror"]
half-space = []
legal-id = ["dep:thiserror"]
words-to-number = ["dep:thiserror", "commas", "digits", "remove-ordinal-suffix"]
sheba = ["dep:thiserror"]
remaining-time = ["time-ago"]

[package.metadata.docs.rs]
all-features = true
Expand Down
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ all: build check test docs
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 legal-id words-to-number sheba remaining-time
build: full default add-ordinal-suffix commas digits find-capital-by-province persian-chars national-id remove-ordinal-suffix url-fix verity-card-number 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 words-to-number sheba time-diff

check: clippy lint

Expand Down Expand Up @@ -84,11 +84,6 @@ verity-card-number:
cargo build --no-default-features --features=verity-card-number
@ ls -sh target/debug/*.rlib

time-ago:
@ echo ""
cargo build --no-default-features --features=time-ago
@ ls -sh target/debug/*.rlib

number-plate:
@ echo ""
cargo build --no-default-features --features=number-plate
Expand Down Expand Up @@ -146,8 +141,7 @@ sheba:
cargo build --no-default-features --features=sheba
@ ls -sh target/debug/*.rlib

remaining-time:
time-diff:
@ echo ""
cargo build --no-default-features --features=remaining-time
cargo build --no-default-features --features=time-diff
@ ls -sh target/debug/*.rlib

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Rust🦀 implementation of [Persian-Tools](https://github.com/persian-tools/pers
- phone_number
- remove_ordinal_suffix
- sheba
- time_ago
- time_diff
- url_fix
- verity_card_number
- words_to_number
Expand Down
10 changes: 3 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
feature = "number-to-words",
feature = "get-bank-name-by-card-number",
feature = "extract-card-number",
feature = "time-ago",
feature = "get-place-by-iran-national-id",
feature = "half-space",
feature = "legal-id",
feature = "words-to-number",
feature = "sheba",
feature = "remaining-time",
feature = "time-diff",
)))]
compile_error!("No available Cargo feature is included");

Expand Down Expand Up @@ -72,8 +71,8 @@ pub mod get_bank_name_by_card_number;
#[cfg(feature = "extract-card-number")]
pub mod extract_card_number;

#[cfg(feature = "time-ago")]
pub mod time_ago;
#[cfg(feature = "time-diff")]
pub mod time_diff;

#[cfg(feature = "get-place-by-iran-national-id")]
pub mod get_place_by_iran_national_id;
Expand All @@ -89,6 +88,3 @@ pub mod words_to_number;

#[cfg(feature = "sheba")]
pub mod sheba;

#[cfg(feature = "remaining-time")]
pub mod remaining_time;
192 changes: 0 additions & 192 deletions src/remaining_time/mod.rs

This file was deleted.

Loading