From 944d591121865c7c6856c91bfe9d2e91b2d5ff44 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Thu, 10 Mar 2022 08:36:46 +0100 Subject: 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. --- askama_derive/src/lib.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'askama_derive/src') 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 { 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"), -}; -- cgit