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

Use minimal regex/fancy-regex build features to reduce build size #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ maintenance = { status = "passively-maintained" }

[dependencies]
derive_builder = { version = "0.12.0", optional = true }
fancy-regex = "0.11.0"
itertools = "0.10.0"
lazy_static = "1.3"
quick-error = "2.0"
regex = "1"
time = { version = "0.3" }

[dependencies.regex]
version = "1"
default-features = false
features = ["std"]

[dependencies.fancy-regex]
version = "0.13.0"
default-features = false
features = ["std"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3.56"

Expand Down
2 changes: 1 addition & 1 deletion src/matching/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@
table
};
static ref MAYBE_DATE_NO_SEPARATOR_REGEX: Regex = Regex::new(r"^[0-9]{4,8}$").unwrap();
static ref MAYBE_DATE_WITH_SEPARATOR_REGEX: Regex = Regex::new(r"^([0-9]{1,4})([\s/\\_.-])([0-9]{1,2})([\s/\\_.-])([0-9]{1,4})$").unwrap();
static ref MAYBE_DATE_WITH_SEPARATOR_REGEX: Regex = Regex::new(r"^([0-9]{1,4})([ \t\r\n/\\_.-])([0-9]{1,2})([[ \t\r\n/\\_.-]/\\_.-])([0-9]{1,4})$").unwrap();
}

#[cfg(test)]
Expand Down Expand Up @@ -990,7 +990,7 @@
} else {
panic!("Wrong match pattern")
};
assert_eq!(p.reversed, true);

Check warning on line 993 in src/matching/mod.rs

View workflow job for this annotation

GitHub Actions / clippy-rustfmt

used `assert_eq!` with a literal bool
}
}

Expand Down Expand Up @@ -1063,7 +1063,7 @@
} else {
panic!("Wrong match pattern")
};
assert_eq!(p.l33t, true);

Check warning on line 1066 in src/matching/mod.rs

View workflow job for this annotation

GitHub Actions / clippy-rustfmt

used `assert_eq!` with a literal bool
}
}

Expand All @@ -1082,7 +1082,7 @@
} else {
panic!("Wrong match pattern")
};
assert_eq!(p.l33t, true);

Check warning on line 1085 in src/matching/mod.rs

View workflow job for this annotation

GitHub Actions / clippy-rustfmt

used `assert_eq!` with a literal bool
}
}

Expand Down Expand Up @@ -1208,7 +1208,7 @@
panic!("Wrong match pattern")
};
assert_eq!(p.sequence_name, "lower");
assert_eq!(p.ascending, false);

Check warning on line 1211 in src/matching/mod.rs

View workflow job for this annotation

GitHub Actions / clippy-rustfmt

used `assert_eq!` with a literal bool
}

#[test]
Expand Down
Loading