From 7d1c1046ba918625fef44a204c219188824f46fb Mon Sep 17 00:00:00 2001 From: Yannik Sander Date: Tue, 30 Aug 2022 10:13:08 +0200 Subject: [PATCH] Allow elastic feature to be disabled (#529) --- flake-info/Cargo.toml | 6 +++++- flake-info/src/lib.rs | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/flake-info/Cargo.toml b/flake-info/Cargo.toml index f83b8c1..7e5ac17 100644 --- a/flake-info/Cargo.toml +++ b/flake-info/Cargo.toml @@ -27,7 +27,11 @@ sha2 = "0.9" pandoc = "0.8" semver = "1.0" -elasticsearch = {git = "https://github.com/elastic/elasticsearch-rs", features = ["rustls-tls"]} +elasticsearch = {git = "https://github.com/elastic/elasticsearch-rs", features = ["rustls-tls"], optional = true} + +[features] +default = ["elastic"] +elastic = ["elasticsearch"] [lib] name = "flake_info" diff --git a/flake-info/src/lib.rs b/flake-info/src/lib.rs index c55d278..b4fbd0f 100644 --- a/flake-info/src/lib.rs +++ b/flake-info/src/lib.rs @@ -5,6 +5,8 @@ use data::{import::Kind, Export, Flake, Source}; pub mod commands; pub mod data; + +#[cfg(feature = "elastic")] pub mod elastic; pub use commands::get_flake_info;