Skip to content

Commit

Permalink
remove some unused dependency + features
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrsd authored Apr 4, 2024
1 parent 68a1e1c commit 6f22f32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 155 deletions.
151 changes: 1 addition & 150 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ name = "drivel"
description = "Infer a schema from JSON input, and generate synthetic data based on the inferred schema."
license = "MIT"
authors = ["Daniël Hogers <[email protected]>"]
version = "0.1.14"
version = "0.1.15"
edition = "2021"
repository = "https://github.com/hgrsd/drivel"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
chrono = "0.4.37"
chrono = { version = "0.4.37", default-features = false, features = ["alloc"] }
clap = { version = "4.5.4", features = ["derive"] }
email_address = "0.2.4"
fake = { version = "2.9.2", features = ["chrono"] }
jemallocator = "0.5.4"
lazy_static = "1.4.0"
Expand Down
6 changes: 4 additions & 2 deletions src/infer_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ lazy_static! {
regex::Regex::new(r"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
.unwrap();
static ref HOSTNAME_REGEX: regex::Regex =
regex::Regex::new(r"^[a-zA-Z0-9\-]+\.[a-zA-Z]{2}[a-zA-Z]*$").unwrap();
regex::Regex::new(r"^[a-zA-Z0-9\-]+\.[a-zA-Z]{2,}$").unwrap();
static ref EMAIL_REGEX: regex::Regex =
regex::Regex::new(r"[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z]{2,}$").unwrap();
}

pub(crate) fn infer_string_type(s: &str) -> StringType {
Expand All @@ -18,7 +20,7 @@ pub(crate) fn infer_string_type(s: &str) -> StringType {
StringType::DateTimeISO8601
} else if UUIDREGEX.is_match(s) {
StringType::UUID
} else if email_address::EmailAddress::is_valid(s) {
} else if EMAIL_REGEX.is_match(s) {
StringType::Email
} else if let Ok(_) = url::Url::parse(s) {
StringType::Url
Expand Down

0 comments on commit 6f22f32

Please sign in to comment.