@@ -57,7 +57,7 @@ mod tests {
5757
5858 use thrift:: protocol:: {
5959 TBinaryInputProtocol , TBinaryOutputProtocol , TFieldIdentifier , TOutputProtocol ,
60- TStructIdentifier , TType ,
60+ TSerializable , TStructIdentifier , TType ,
6161 } ;
6262
6363 // Serialize AidKit with an unknown union variant (id=99), verify it deserializes as None.
@@ -71,19 +71,16 @@ mod tests {
7171 name : "AidKit" . to_owned ( ) ,
7272 } )
7373 . unwrap ( ) ;
74- // field 1: optional aid (union => Struct on wire)
7574 prot. write_field_begin ( & TFieldIdentifier {
7675 name : None ,
7776 field_type : TType :: Struct ,
7877 id : Some ( 1 ) ,
7978 } )
8079 . unwrap ( ) ;
81- // inner union-as-struct
8280 prot. write_struct_begin ( & TStructIdentifier {
8381 name : "MeasuringAids" . to_owned ( ) ,
8482 } )
8583 . unwrap ( ) ;
86- // unknown variant: use an id that doesn't exist (99), type i32
8784 prot. write_field_begin ( & TFieldIdentifier {
8885 name : None ,
8986 field_type : TType :: I32 ,
@@ -94,13 +91,11 @@ mod tests {
9491 prot. write_field_end ( ) . unwrap ( ) ;
9592 prot. write_field_stop ( ) . unwrap ( ) ;
9693 prot. write_struct_end ( ) . unwrap ( ) ;
97- // end outer field
9894 prot. write_field_end ( ) . unwrap ( ) ;
9995 prot. write_field_stop ( ) . unwrap ( ) ;
10096 prot. write_struct_end ( ) . unwrap ( ) ;
10197 }
10298
103- // Read it back using generated code
10499 let read_cursor = Cursor :: new ( write_buf) ;
105100 let mut rprot = TBinaryInputProtocol :: new ( read_cursor, false ) ;
106101 let kit = base_one:: AidKit :: read_from_in_protocol ( & mut rprot)
0 commit comments