@@ -103,17 +103,16 @@ pub enum EbmlEncoderTag {
103
103
104
104
EsStr = 0x11 ,
105
105
EsEnum = 0x12 ,
106
- EsEnumBody = 0x13 ,
107
- EsVec = 0x14 ,
108
- EsVecElt = 0x15 ,
109
- EsMap = 0x16 ,
110
- EsMapKey = 0x17 ,
111
- EsMapVal = 0x18 ,
106
+ EsVec = 0x13 ,
107
+ EsVecElt = 0x14 ,
108
+ EsMap = 0x15 ,
109
+ EsMapKey = 0x16 ,
110
+ EsMapVal = 0x17 ,
112
111
113
- EsOpaque = 0x19 ,
112
+ EsOpaque = 0x18 ,
114
113
115
114
// Used only when debugging
116
- EsLabel = 0x1a ,
115
+ EsLabel = 0x19 ,
117
116
}
118
117
119
118
const NUM_TAGS : uint = 0x1000 ;
@@ -160,7 +159,7 @@ pub mod reader {
160
159
use super :: { ApplicationError , EsVec , EsMap , EsEnum , EsVecLen , EsVecElt ,
161
160
EsMapLen , EsMapKey , EsEnumVid , EsU64 , EsU32 , EsU16 , EsU8 , EsInt , EsI64 ,
162
161
EsI32 , EsI16 , EsI8 , EsBool , EsF64 , EsF32 , EsChar , EsStr , EsMapVal ,
163
- EsEnumBody , EsUint , EsOpaque , EsLabel , EbmlEncoderTag , Doc , TaggedDoc ,
162
+ EsUint , EsOpaque , EsLabel , EbmlEncoderTag , Doc , TaggedDoc ,
164
163
Error , IntTooBig , InvalidTag , Expected , NUM_IMPLICIT_TAGS , TAG_IMPLICIT_LEN } ;
165
164
166
165
pub type DecodeResult < T > = Result < T , Error > ;
@@ -564,17 +563,7 @@ pub mod reader {
564
563
let idx = try!( self . _next_uint ( EsEnumVid ) ) ;
565
564
debug ! ( " idx={}" , idx) ;
566
565
567
- let doc = try!( self . next_doc ( EsEnumBody ) ) ;
568
-
569
- let ( old_parent, old_pos) = ( self . parent , self . pos ) ;
570
- self . parent = doc;
571
- self . pos = self . parent . start ;
572
-
573
- let result = try!( f ( self , idx) ) ;
574
-
575
- self . parent = old_parent;
576
- self . pos = old_pos;
577
- Ok ( result)
566
+ f ( self , idx)
578
567
}
579
568
580
569
fn read_enum_variant_arg < T , F > ( & mut self , idx : uint , f : F ) -> DecodeResult < T > where
@@ -592,17 +581,7 @@ pub mod reader {
592
581
let idx = try!( self . _next_uint ( EsEnumVid ) ) ;
593
582
debug ! ( " idx={}" , idx) ;
594
583
595
- let doc = try!( self . next_doc ( EsEnumBody ) ) ;
596
-
597
- let ( old_parent, old_pos) = ( self . parent , self . pos ) ;
598
- self . parent = doc;
599
- self . pos = self . parent . start ;
600
-
601
- let result = try!( f ( self , idx) ) ;
602
-
603
- self . parent = old_parent;
604
- self . pos = old_pos;
605
- Ok ( result)
584
+ f ( self , idx)
606
585
}
607
586
608
587
fn read_enum_struct_variant_field < T , F > ( & mut self ,
@@ -743,7 +722,7 @@ pub mod writer {
743
722
744
723
use super :: { EsVec , EsMap , EsEnum , EsVecLen , EsVecElt , EsMapLen , EsMapKey ,
745
724
EsEnumVid , EsU64 , EsU32 , EsU16 , EsU8 , EsInt , EsI64 , EsI32 , EsI16 , EsI8 ,
746
- EsBool , EsF64 , EsF32 , EsChar , EsStr , EsMapVal , EsEnumBody , EsUint ,
725
+ EsBool , EsF64 , EsF32 , EsChar , EsStr , EsMapVal , EsUint ,
747
726
EsOpaque , EsLabel , EbmlEncoderTag , NUM_IMPLICIT_TAGS , NUM_TAGS } ;
748
727
749
728
use serialize;
@@ -1059,9 +1038,7 @@ pub mod writer {
1059
1038
F : FnOnce ( & mut Encoder < ' a , W > ) -> EncodeResult ,
1060
1039
{
1061
1040
try!( self . _emit_tagged_uint ( EsEnumVid , v_id) ) ;
1062
- try!( self . start_tag ( EsEnumBody as uint ) ) ;
1063
- try!( f ( self ) ) ;
1064
- self . end_tag ( )
1041
+ f ( self )
1065
1042
}
1066
1043
1067
1044
fn emit_enum_variant_arg < F > ( & mut self , _: uint , f : F ) -> EncodeResult where
0 commit comments