From c707aa81e10a17d34a380b5664b16b17e4ff32a0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Clulow" Date: Wed, 1 Sep 2021 18:56:51 +0000 Subject: [PATCH] chrono import should be conditional and needs the serde feature --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d489fa3..7b39fc7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1382,6 +1382,11 @@ fn main() -> Result<()> { */ let mut toml = root.clone(); toml.push("Cargo.toml"); + let chrono = if ts.import_chrono { + "chrono = { version = \"0.4\", features = [\"serde\"] }\n" + } else { + "" + }; let tomlout = format!( "[package]\n\ name = \"{}\"\n\ @@ -1390,11 +1395,11 @@ fn main() -> Result<()> { \n\ [dependencies]\n\ anyhow = \"1\"\n\ - chrono = \"0.4\"\n\ + {}\ percent-encoding = \"2.1\"\n\ reqwest = {{ version = \"0.11\", features = [\"json\"] }}\n\ serde = {{ version = \"1\", features = [\"derive\"] }}\n", - name, version, + name, version, chrono, ); save(&toml, tomlout.as_str())?;