@@ -797,19 +797,13 @@ mod content {
797797 /// Used by generated code to deserialize an internally tagged enum.
798798 ///
799799 /// Not public API.
800- pub struct TaggedContent < ' de , T > {
801- pub tag : T ,
802- pub content : Content < ' de > ,
803- }
804-
805- /// Not public API.
806- pub struct TaggedContentVisitor < ' de , T > {
800+ pub struct TaggedContentVisitor < T > {
807801 tag_name : & ' static str ,
808802 expecting : & ' static str ,
809- value : PhantomData < TaggedContent < ' de , T > > ,
803+ value : PhantomData < T > ,
810804 }
811805
812- impl < ' de , T > TaggedContentVisitor < ' de , T > {
806+ impl < T > TaggedContentVisitor < T > {
813807 /// Visitor for the content of an internally tagged enum with the given
814808 /// tag name.
815809 pub fn new ( name : & ' static str , expecting : & ' static str ) -> Self {
@@ -821,11 +815,11 @@ mod content {
821815 }
822816 }
823817
824- impl < ' de , T > Visitor < ' de > for TaggedContentVisitor < ' de , T >
818+ impl < ' de , T > Visitor < ' de > for TaggedContentVisitor < T >
825819 where
826820 T : Deserialize < ' de > ,
827821 {
828- type Value = TaggedContent < ' de , T > ;
822+ type Value = ( T , Content < ' de > ) ;
829823
830824 fn expecting ( & self , fmt : & mut fmt:: Formatter ) -> fmt:: Result {
831825 fmt. write_str ( self . expecting )
@@ -842,10 +836,7 @@ mod content {
842836 }
843837 } ;
844838 let rest = de:: value:: SeqAccessDeserializer :: new ( seq) ;
845- Ok ( TaggedContent {
846- tag,
847- content : try!( Content :: deserialize ( rest) ) ,
848- } )
839+ Ok ( ( tag, try!( Content :: deserialize ( rest) ) ) )
849840 }
850841
851842 fn visit_map < M > ( self , mut map : M ) -> Result < Self :: Value , M :: Error >
@@ -870,10 +861,7 @@ mod content {
870861 }
871862 match tag {
872863 None => Err ( de:: Error :: missing_field ( self . tag_name ) ) ,
873- Some ( tag) => Ok ( TaggedContent {
874- tag,
875- content : Content :: Map ( vec) ,
876- } ) ,
864+ Some ( tag) => Ok ( ( tag, Content :: Map ( vec) ) ) ,
877865 }
878866 }
879867 }
0 commit comments