From dae213f0f31d764a0c00aeb39f145222050bc657 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Thu, 16 May 2024 19:53:33 -0700 Subject: [PATCH 1/2] New version: 0.10.19. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b6cc2c4..cd6bf40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "figment" -version = "0.10.18" +version = "0.10.19" authors = ["Sergio Benitez "] edition = "2018" documentation = "https://docs.rs/figment/0.10" From 6a363a1f7ae9a4e9935cc7b95b780098053029b5 Mon Sep 17 00:00:00 2001 From: mo8it Date: Tue, 7 May 2024 01:57:55 +0200 Subject: [PATCH 2/2] Use 'toml_edit' directly instead of via 'toml'. --- .gitignore | 8 +------- Cargo.toml | 10 +++++----- src/providers/data.rs | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index a795ba7..4308d82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,3 @@ target/ **/*.rs.bk - - -# Added by cargo -# -# already existing elements were commented out - -#/target +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index cd6bf40..14f98a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,18 +12,18 @@ license = "MIT OR Apache-2.0" categories = ["config"] [features] -env = ["pear", "parse-value"] +env = ["parse-value"] json = ["serde_json"] -yaml = ["serde_yaml"] parse-value = ["pear"] test = ["tempfile", "parking_lot"] -# toml = ["toml"] +toml = ["toml_edit"] +yaml = ["serde_yaml"] [dependencies] -serde = { version = "1.0" } +serde = "1.0" uncased = "0.9.3" pear = { version = "0.2", optional = true } -toml = { version = "0.8", optional = true } +toml_edit = { version = "0.22", optional = true, default-features = false, features = ["parse", "serde"] } serde_json = { version = "1.0", optional = true } serde_yaml = { version = "0.9", optional = true } tempfile = { version = "3", optional = true } diff --git a/src/providers/data.rs b/src/providers/data.rs index 5964579..5b9f961 100644 --- a/src/providers/data.rs +++ b/src/providers/data.rs @@ -518,7 +518,7 @@ impl YamlExtended { } } -impl_format!(Toml "TOML"/"toml": toml::from_str, toml::de::Error); +impl_format!(Toml "TOML"/"toml": toml_edit::de::from_str, toml_edit::de::Error); impl_format!(Yaml "YAML"/"yaml": serde_yaml::from_str, serde_yaml::Error); impl_format!(Json "JSON"/"json": serde_json::from_str, serde_json::error::Error); impl_format!(YamlExtended "YAML Extended"/"yaml": YamlExtended::from_str, serde_yaml::Error);