Skip to content

Commit

Permalink
do not generate snippets if feature disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
generall committed Jul 1, 2024
1 parent 1a8612a commit 3180709
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ tonic-build = { version = "0.11.0", features = ["prost"] }
tokio = { version = "1.36.0", features = ["rt-multi-thread"] }

[features]
default = ["download_snapshots", "serde"]
default = ["download_snapshots", "serde", "generate-snippets"]
download_snapshots = ["reqwest", "futures-util"]
serde = ["dep:serde", "dep:serde_json"]
generate-snippets = []

[[example]]
name = "search"
Expand All @@ -43,4 +44,5 @@ name = "deprecated_search"
required-features = ["serde"]

[package.metadata.docs.rs]
all-features = true
features = ["download_snapshots", "serde"]
no-default-features = true
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ async fn test_{name}() {{
fn main() {
println!("cargo:rerun-if-changed=tests/snippets");

#[cfg(not(feature = "generate-snippets"))]
return;

// Open all files in the `./tests/snippets` directory and save them to the `./tests/snippets_converted` directory
// Wrap text in the `tests/test_snippets.rs` file into { }
let snippets_dir = Path::new("./tests/snippets");
Expand Down

0 comments on commit 3180709

Please sign in to comment.