build: make regex optional and gated by server feature

This commit is contained in:
xfy 2026-06-16 17:09:16 +08:00
parent 837f120621
commit 6489ac604e
2 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,7 @@ deadpool-postgres = { version = "0.14", optional = true }
argon2 = { version = "0.5", optional = true }
uuid = { version = "1", features = ["v4", "js"], optional = true }
chrono = { version = "0.4", features = ["serde"] }
regex = "1.12"
regex = { version = "1.12", optional = true }
pulldown-cmark = "0.13"
dotenvy = { version = "0.15", optional = true }
tracing = { version = "0.1", optional = true, features = ["release_max_level_info"] }
@ -62,6 +62,7 @@ server = [
"dep:deadpool-postgres",
"dep:argon2",
"dep:uuid",
"dep:regex",
"dep:dotenvy",
"dep:tracing",
"dep:tracing-subscriber",

View File

@ -78,7 +78,7 @@ pub fn auto_summary(md: &str) -> String {
plain.chars().take(200).collect()
}
#[cfg(test)]
#[cfg(all(test, feature = "server"))]
mod tests {
use super::*;