From 42282621ea5053f58830ff11b0905341632a2060 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 9 Dec 2019 09:50:47 -0700 Subject: [PATCH] refactor(config): Reduce deps --- Cargo.lock | 2 +- crates/config/Cargo.toml | 2 +- crates/config/src/frontmatter.rs | 13 ++++++------- crates/config/src/site.rs | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33514ba..24e4ec4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -518,7 +518,7 @@ dependencies = [ "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "deunicode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "liquid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", + "liquid-value 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index b9b40a1..39bd79c 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -15,7 +15,7 @@ travis-ci = { repository = "cobalt-org/cobalt.rs" } appveyor = { repository = "cobalt-org/cobalt.rs" } [dependencies] -liquid = "0.19" +liquid-value = "0.19" chrono = "0.4" log = "0.4" regex = "1.1" diff --git a/crates/config/src/frontmatter.rs b/crates/config/src/frontmatter.rs index 2c60a99..4b88017 100644 --- a/crates/config/src/frontmatter.rs +++ b/crates/config/src/frontmatter.rs @@ -1,7 +1,6 @@ use std::fmt; use std::path; -use liquid; use serde; use super::*; @@ -35,8 +34,8 @@ pub struct Frontmatter { pub is_draft: Option, #[serde(skip_serializing_if = "Option::is_none")] pub weight: Option, - #[serde(skip_serializing_if = "liquid::value::Object::is_empty")] - pub data: liquid::value::Object, + #[serde(skip_serializing_if = "liquid_value::Object::is_empty")] + pub data: liquid_value::Object, #[serde(skip_serializing_if = "Option::is_none")] pub pagination: Option, // Controlled by where the file is found. We might allow control over the type at a later @@ -182,11 +181,11 @@ impl Default for SourceFormat { } } -/// Shallow merge of `liquid::value::Object`'s +/// Shallow merge of `liquid_value::Object`'s fn merge_objects( - mut primary: liquid::value::Object, - secondary: &liquid::value::Object, -) -> liquid::value::Object { + mut primary: liquid_value::Object, + secondary: &liquid_value::Object, +) -> liquid_value::Object { for (key, value) in secondary { primary .entry(key.to_owned()) diff --git a/crates/config/src/site.rs b/crates/config/src/site.rs index e4ae078..ab4e68d 100644 --- a/crates/config/src/site.rs +++ b/crates/config/src/site.rs @@ -5,7 +5,7 @@ pub struct Site { pub description: Option, pub base_url: Option, pub sitemap: Option, - pub data: Option, + pub data: Option, #[serde(skip)] pub data_dir: &'static str, }