diff options
-rw-r--r-- | askama_derive/Cargo.toml | 4 | ||||
-rw-r--r-- | askama_derive/src/config.rs | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/askama_derive/Cargo.toml b/askama_derive/Cargo.toml index 61cce97..15dd36b 100644 --- a/askama_derive/Cargo.toml +++ b/askama_derive/Cargo.toml @@ -14,7 +14,7 @@ rust-version = "1.58" proc-macro = true [features] -config = ["serde", "toml"] +config = ["serde", "toml_edit"] humansize = [] markdown = [] urlencode = [] @@ -38,4 +38,4 @@ proc-macro2 = "1" quote = "1" serde = { version = "1.0", optional = true, features = ["derive"] } syn = "1" -toml = { version = "0.5", optional = true } +toml_edit = { version = "0.19", optional = true, features = ["serde"] } diff --git a/askama_derive/src/config.rs b/askama_derive/src/config.rs index 4dcf1ea..a075744 100644 --- a/askama_derive/src/config.rs +++ b/askama_derive/src/config.rs @@ -192,7 +192,8 @@ struct RawConfig { impl RawConfig { #[cfg(feature = "config")] fn from_toml_str(s: &str) -> std::result::Result<RawConfig, CompileError> { - toml::from_str(s).map_err(|e| format!("invalid TOML in {CONFIG_FILE_NAME}: {e}").into()) + toml_edit::de::from_str(s) + .map_err(|e| format!("invalid TOML in {CONFIG_FILE_NAME}: {e}").into()) } #[cfg(not(feature = "config"))] |