aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-03-10 08:36:46 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-03-23 19:37:10 +0100
commit944d591121865c7c6856c91bfe9d2e91b2d5ff44 (patch)
treeb8fba2f7b11ca5b302e16a3eede4fd66cdda48d3 /askama_derive/src/lib.rs
parentc984945cd5d5b81c89510996988f31cdfdb4bd2b (diff)
downloadaskama-944d591121865c7c6856c91bfe9d2e91b2d5ff44.tar.gz
askama-944d591121865c7c6856c91bfe9d2e91b2d5ff44.tar.bz2
askama-944d591121865c7c6856c91bfe9d2e91b2d5ff44.zip
Move handling of integrations into askama_shared
Before this PR the handling of integrations was done both by askama_shared and askama_derive. This diff lets askama_shared do the work. This will prevent problems like #629, when both packages might come out of sync.
Diffstat (limited to '')
-rw-r--r--askama_derive/src/lib.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs
index 00936d0..d04ef72 100644
--- a/askama_derive/src/lib.rs
+++ b/askama_derive/src/lib.rs
@@ -5,9 +5,7 @@
use askama_shared::heritage::{Context, Heritage};
use askama_shared::input::{Print, Source, TemplateInput};
use askama_shared::parser::{parse, Expr, Node};
-use askama_shared::{
- generator, get_template_source, read_config_file, CompileError, Config, Integrations,
-};
+use askama_shared::{generator, get_template_source, read_config_file, CompileError, Config};
use proc_macro::TokenStream;
use std::collections::HashMap;
@@ -62,7 +60,7 @@ fn build_template(ast: &syn::DeriveInput) -> Result<String, CompileError> {
eprintln!("{:?}", parsed[input.path.as_path()]);
}
- let code = generator::generate(&input, &contexts, heritage.as_ref(), INTEGRATIONS)?;
+ let code = generator::generate(&input, &contexts, heritage.as_ref())?;
if input.print == Print::Code || input.print == Print::All {
eprintln!("{}", code);
}
@@ -108,13 +106,3 @@ fn find_used_templates(
}
Ok(())
}
-
-const INTEGRATIONS: Integrations = Integrations {
- actix: cfg!(feature = "actix-web"),
- axum: cfg!(feature = "axum"),
- gotham: cfg!(feature = "gotham"),
- mendes: cfg!(feature = "mendes"),
- rocket: cfg!(feature = "rocket"),
- tide: cfg!(feature = "tide"),
- warp: cfg!(feature = "warp"),
-};