File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
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,10 +59,12 @@ impl fmt::Debug for MessageWithOneofCustomDebug {
5459/// Enumerations inside oneofs
5560#[ test]
5661fn oneof_with_enum_custom_debug ( ) {
62+ let of = OneofWithEnumCustomDebug :: Enumeration (
63+ BasicEnumeration :: TWO as i32 ,
64+ ) ;
65+ assert_eq ! ( format!( "{:?}" , of) , "OneofWithEnumCustomDebug {..}" ) ;
5766 let msg = MessageWithOneofCustomDebug {
58- of : Some ( OneofWithEnumCustomDebug :: Enumeration (
59- BasicEnumeration :: TWO as i32 ,
60- ) ) ,
67+ of : Some ( of) ,
6168 } ;
6269 assert_eq ! ( format!( "{:?}" , msg) , "MessageWithOneofCustomDebug {..}" ) ;
6370}
You can’t perform that action at this time.
0 commit comments