From eddd7efabc4abcde43b1f1e57b7adfa454fe5523 Mon Sep 17 00:00:00 2001 From: Arnaud de Bossoreille Date: Tue, 11 Feb 2025 21:29:52 +0100 Subject: [PATCH] Reexport handlebars and serde types and reduce explicit dependencies --- codegen/quirky_binder_codegen/src/gen.rs | 3 --- examples/quirky_binder_example_index_first_char/Cargo.toml | 2 -- examples/quirky_binder_example_tree/Cargo.toml | 2 -- examples/quirky_binder_example_wordlist/Cargo.toml | 2 -- quirky_binder/src/prelude.rs | 3 +++ recipes/csv/Cargo.toml | 2 -- recipes/hello_world/Cargo.toml | 2 -- recipes/postgres/Cargo.toml | 2 -- recipes/template/Cargo.toml | 2 -- tests/quirky_binder_tests_source/Cargo.toml | 2 -- 10 files changed, 3 insertions(+), 19 deletions(-) diff --git a/codegen/quirky_binder_codegen/src/gen.rs b/codegen/quirky_binder_codegen/src/gen.rs index 8b24beb..078a16f 100644 --- a/codegen/quirky_binder_codegen/src/gen.rs +++ b/codegen/quirky_binder_codegen/src/gen.rs @@ -637,13 +637,10 @@ pub(crate) fn generate_module<'a>( }); error_emitter.error()?; Ok(quote! { - use handlebars::Handlebars; use std::collections::BTreeMap; mod __quirky_binder_private { use #quirky_binder_crate::prelude::*; - use handlebars::Handlebars; - use serde::Deserialize; use std::collections::BTreeMap; use truc::record::type_resolver::TypeResolver; diff --git a/examples/quirky_binder_example_index_first_char/Cargo.toml b/examples/quirky_binder_example_index_first_char/Cargo.toml index de33fda..3663bfd 100644 --- a/examples/quirky_binder_example_index_first_char/Cargo.toml +++ b/examples/quirky_binder_example_index_first_char/Cargo.toml @@ -24,8 +24,6 @@ quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] [build-dependencies] getset = "0.1" -handlebars = "4" quirky_binder = { path = "../../quirky_binder" } quote = "1" -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" } diff --git a/examples/quirky_binder_example_tree/Cargo.toml b/examples/quirky_binder_example_tree/Cargo.toml index 9932604..b2ca192 100644 --- a/examples/quirky_binder_example_tree/Cargo.toml +++ b/examples/quirky_binder_example_tree/Cargo.toml @@ -23,7 +23,5 @@ default = [] quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] [build-dependencies] -handlebars = "4" quirky_binder = { path = "../../quirky_binder" } -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" } diff --git a/examples/quirky_binder_example_wordlist/Cargo.toml b/examples/quirky_binder_example_wordlist/Cargo.toml index 9eecdda..22ec03a 100644 --- a/examples/quirky_binder_example_wordlist/Cargo.toml +++ b/examples/quirky_binder_example_wordlist/Cargo.toml @@ -24,6 +24,4 @@ quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] [build-dependencies] quirky_binder = { path = "../../quirky_binder" } quirky_binder_support = { path = "../../quirky_binder_support" } -handlebars = "4" -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" } diff --git a/quirky_binder/src/prelude.rs b/quirky_binder/src/prelude.rs index c23a736..e0d194e 100644 --- a/quirky_binder/src/prelude.rs +++ b/quirky_binder/src/prelude.rs @@ -1,3 +1,6 @@ +pub use handlebars::Handlebars; +pub use serde::Deserialize; + pub use crate::{ chain::{ error::{ChainError, ChainErrorWithTrace}, diff --git a/recipes/csv/Cargo.toml b/recipes/csv/Cargo.toml index 08e66b1..42303c0 100644 --- a/recipes/csv/Cargo.toml +++ b/recipes/csv/Cargo.toml @@ -22,8 +22,6 @@ default = [] quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] [build-dependencies] -handlebars = "4" quirky_binder = { path = "../../quirky_binder" } quirky_binder_csv = { path = "../../contrib/quirky_binder_csv" } -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" } diff --git a/recipes/hello_world/Cargo.toml b/recipes/hello_world/Cargo.toml index 0985e49..4b87606 100644 --- a/recipes/hello_world/Cargo.toml +++ b/recipes/hello_world/Cargo.toml @@ -21,7 +21,5 @@ default = [] quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] [build-dependencies] -handlebars = "4" quirky_binder = { path = "../../quirky_binder" } -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" } diff --git a/recipes/postgres/Cargo.toml b/recipes/postgres/Cargo.toml index 7cc30ac..cde3e01 100644 --- a/recipes/postgres/Cargo.toml +++ b/recipes/postgres/Cargo.toml @@ -22,7 +22,5 @@ default = [] quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] [build-dependencies] -handlebars = "4" quirky_binder = { path = "../../quirky_binder" } -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" } diff --git a/recipes/template/Cargo.toml b/recipes/template/Cargo.toml index 4ed67cc..bc148cb 100644 --- a/recipes/template/Cargo.toml +++ b/recipes/template/Cargo.toml @@ -21,7 +21,5 @@ default = [] quirky_binder_monitor = ["chrono", "self-meter", "tracking-allocator"] [build-dependencies] -handlebars = "4" quirky_binder = { path = "../../quirky_binder" } -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" } diff --git a/tests/quirky_binder_tests_source/Cargo.toml b/tests/quirky_binder_tests_source/Cargo.toml index 3acf75b..10e4beb 100644 --- a/tests/quirky_binder_tests_source/Cargo.toml +++ b/tests/quirky_binder_tests_source/Cargo.toml @@ -6,8 +6,6 @@ rust-version = "1.65.0" [dependencies] anyhow = "1" -handlebars = "4" quirky_binder = { path = "../../quirky_binder" } quirky_binder_csv = { path = "../../contrib/quirky_binder_csv" } -serde = { version = "1", features = ["derive"] } truc = { git = "https://github.com/arnodb/truc.git" }