File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ pub enum OneofWithEnumCustomDebug {
3737 #[ prost( enumeration = "BasicEnumeration" , tag = "10" ) ]
3838 Enumeration ( i32 ) ,
3939}
40+ impl fmt:: Debug for OneofWithEnumCustomDebug {
41+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
42+ f. write_str ( "OneofWithEnumCustomDebug {..}" )
43+ }
44+ }
4045
4146#[ derive( Clone , PartialEq , prost:: Message ) ]
4247#[ prost( skip_debug) ]
@@ -54,11 +59,9 @@ impl fmt::Debug for MessageWithOneofCustomDebug {
5459/// Enumerations inside oneofs
5560#[ test]
5661fn oneof_with_enum_custom_debug ( ) {
57- let msg = MessageWithOneofCustomDebug {
58- of : Some ( OneofWithEnumCustomDebug :: Enumeration (
59- BasicEnumeration :: TWO as i32 ,
60- ) ) ,
61- } ;
62+ let of = OneofWithEnumCustomDebug :: Enumeration ( BasicEnumeration :: TWO as i32 ) ;
63+ assert_eq ! ( format!( "{:?}" , of) , "OneofWithEnumCustomDebug {..}" ) ;
64+ let msg = MessageWithOneofCustomDebug { of : Some ( of) } ;
6265 assert_eq ! ( format!( "{:?}" , msg) , "MessageWithOneofCustomDebug {..}" ) ;
6366}
6467
You can’t perform that action at this time.
0 commit comments