diff --git a/src/templater.rs b/src/templater.rs index 5f01116c0..753e19873 100644 --- a/src/templater.rs +++ b/src/templater.rs @@ -200,6 +200,28 @@ impl + ?Sized> TemplateProperty for Box

{ } } +// Implement TemplateProperty for tuples +macro_rules! tuple_impls { + ($( ( $($n:tt $T:ident),+ ) )+) => { + $( + impl,)+> TemplateProperty for ($($T,)+) { + type Output = ($($T::Output,)+); + + fn extract(&self, context: &C) -> Self::Output { + ($(self.$n.extract(context),)+) + } + } + )+ + } +} + +tuple_impls! { + (0 T0) + (0 T0, 1 T1) + (0 T0, 1 T1, 2 T2) + (0 T0, 1 T1, 2 T2, 3 T3) +} + /// Adapter to drop template context. pub struct Literal(pub O);