From b3cf9375d459fa7a653acca85a083acaa92fde30 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Tue, 21 Jul 2015 19:34:07 -0700 Subject: [PATCH] Add Tuple Deserializer Visitor constructor --- serde/src/de/impls.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 390d60fb..9184e75a 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -571,6 +571,15 @@ macro_rules! tuple_impls { marker: PhantomData<($($name,)+)>, } + impl< + $($name: Deserialize,)+ + > $visitor<$($name,)+> { + fn new() -> Self { + $visitor { marker: PhantomData } + } + } + + impl< $($name: Deserialize,)+ > Visitor for $visitor<$($name,)+> { @@ -601,7 +610,7 @@ macro_rules! tuple_impls { fn deserialize(deserializer: &mut D) -> Result<($($name,)+), D::Error> where D: Deserializer, { - deserializer.visit_tuple($visitor { marker: PhantomData }) + deserializer.visit_tuple($visitor::new()) } } )+