From 4a3f014925e4e11f14a5ce0a7b3b915fad5569ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Sat, 22 Jun 2024 00:45:39 +0200 Subject: [PATCH] Fix `serde` dependency usage (#141) --- examples/csr-minimal/Cargo.toml | 2 +- leptos-fluent-macros/src/languages.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/csr-minimal/Cargo.toml b/examples/csr-minimal/Cargo.toml index 28ce2ea4..2f243dd9 100644 --- a/examples/csr-minimal/Cargo.toml +++ b/examples/csr-minimal/Cargo.toml @@ -9,7 +9,7 @@ path = "src/lib.rs" [dependencies] leptos = { version = "0.6.12", features = ["csr"] } -leptos-fluent = { path = "../../leptos-fluent" } +leptos-fluent = { path = "../../leptos-fluent", default-features = false } fluent-templates = "0.9" console_error_panic_hook = "0.1" diff --git a/leptos-fluent-macros/src/languages.rs b/leptos-fluent-macros/src/languages.rs index 1de4f946..80867ab5 100644 --- a/leptos-fluent-macros/src/languages.rs +++ b/leptos-fluent-macros/src/languages.rs @@ -1,6 +1,7 @@ use std::fs; use std::path::PathBuf; +#[cfg(any(feature = "json", feature = "yaml", feature = "json5"))] #[derive(serde::Deserialize)] #[serde(untagged)] enum LanguagesFileLanguage { @@ -8,6 +9,7 @@ enum LanguagesFileLanguage { CodeNameDir(String, String, String), } +#[cfg(any(feature = "json", feature = "yaml", feature = "json5"))] fn set_dir_to_languages_from_languages_file( languages: &[LanguagesFileLanguage], ) -> Vec<(String, String, String)> {