77use std:: sync:: Arc ;
88
99use orx_concurrent_vec:: ConcurrentVec ;
10- use serde:: { ser :: SerializeSeq , Serialize } ;
10+ use serde:: Serialize ;
1111
1212/// The kind of problem being reported
13- #[ derive( Serialize , Clone ) ]
13+ #[ derive( Debug , Serialize , Clone ) ]
1414#[ serde( tag = "type" ) ]
1515enum Kind {
1616 /// Expected and Required field is missing
@@ -73,7 +73,7 @@ enum Kind {
7373}
7474
7575/// Problem Report Entry
76- #[ derive( Serialize , Clone ) ]
76+ #[ derive( Debug , Serialize , Clone ) ]
7777struct Entry {
7878 /// The kind of problem we are recording.
7979 kind : Kind ,
@@ -82,22 +82,11 @@ struct Entry {
8282}
8383
8484/// The Problem Report list
85- #[ derive( Clone ) ]
85+ #[ derive( Debug , Clone , Serialize ) ]
8686struct Report ( ConcurrentVec < Entry > ) ;
8787
88- impl Serialize for Report {
89- fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
90- where S : serde:: Serializer {
91- let mut seq = serializer. serialize_seq ( Some ( self . 0 . len ( ) ) ) ?;
92- for e in self . 0 . iter_cloned ( ) {
93- seq. serialize_element ( & e) ?;
94- }
95- seq. end ( )
96- }
97- }
98-
9988/// An inner state of the report.
100- #[ derive( Serialize ) ]
89+ #[ derive( Debug , Serialize ) ]
10190struct State {
10291 /// What context does the whole report have
10392 context : String ,
@@ -108,7 +97,7 @@ struct State {
10897/// Problem Report.
10998///
11099/// This structure allows making a cheap copies that share the same state.
111- #[ derive( Clone , Serialize ) ]
100+ #[ derive( Debug , Clone , Serialize ) ]
112101pub struct ProblemReport ( Arc < State > ) ;
113102
114103impl ProblemReport {
0 commit comments