@@ -15,7 +15,7 @@ use facet_reflect::{
1515 FieldIter , FieldsForSerializeIter , HasFields , Peek , PeekListLikeIter , PeekMapIter , PeekSetIter ,
1616 ScalarType ,
1717} ;
18- use log:: { debug , trace} ;
18+ use log:: trace;
1919
2020fn variant_is_newtype_like ( variant : & facet_core:: Variant ) -> bool {
2121 variant. data . kind == facet_core:: StructKind :: Tuple && variant. data . fields . len ( ) == 1
@@ -284,7 +284,7 @@ where
284284 while let Some ( task) = stack. pop ( ) {
285285 match task {
286286 SerializeTask :: Value ( mut cpeek, maybe_field) => {
287- debug ! ( "Serializing a value, shape is {}" , cpeek. shape( ) ) ;
287+ trace ! ( "Serializing a value, shape is {}" , cpeek. shape( ) ) ;
288288
289289 if cpeek
290290 . shape ( )
@@ -298,12 +298,12 @@ where
298298 cpeek = ps. field ( 0 ) . unwrap ( ) ;
299299
300300 let new_shape = cpeek. shape ( ) ;
301- debug ! (
301+ trace ! (
302302 "{old_shape} is transparent, let's serialize the inner {new_shape} instead"
303303 ) ;
304304 }
305305
306- debug ! (
306+ trace ! (
307307 "Matching def={:?}, ty={:?} for shape={}" ,
308308 cpeek. shape( ) . def,
309309 cpeek. shape( ) . ty,
@@ -489,24 +489,24 @@ where
489489 }
490490 }
491491 ( _, Type :: User ( UserType :: Struct ( sd) ) ) => {
492- debug ! ( "Serializing struct: shape={}" , cpeek. shape( ) , ) ;
493- debug ! (
492+ trace ! ( "Serializing struct: shape={}" , cpeek. shape( ) , ) ;
493+ trace ! (
494494 " Struct details: kind={:?}, field_count={}" ,
495495 sd. kind,
496496 sd. fields. len( )
497497 ) ;
498498
499499 match sd. kind {
500500 StructKind :: Unit => {
501- debug ! ( " Handling unit struct (no fields)" ) ;
501+ trace ! ( " Handling unit struct (no fields)" ) ;
502502 // Correctly handle unit struct type when encountered as a value
503503 serializer. serialize_unit ( ) ?;
504504 }
505505 StructKind :: Tuple => {
506- debug ! ( " Handling tuple with {} fields" , sd. fields. len( ) ) ;
506+ trace ! ( " Handling tuple with {} fields" , sd. fields. len( ) ) ;
507507 let peek_struct = cpeek. into_struct ( ) . unwrap ( ) ;
508508 let fields_iter = peek_struct. fields ( ) ;
509- debug ! ( " Serializing {} fields as tuple" , sd. fields. len( ) ) ;
509+ trace ! ( " Serializing {} fields as tuple" , sd. fields. len( ) ) ;
510510
511511 stack. push ( SerializeTask :: Tuple {
512512 items : fields_iter,
@@ -518,10 +518,10 @@ where
518518 ) ;
519519 }
520520 StructKind :: TupleStruct => {
521- debug ! ( " Handling tuple struct" ) ;
521+ trace ! ( " Handling tuple struct" ) ;
522522 let peek_struct = cpeek. into_struct ( ) . unwrap ( ) ;
523523 let fields = peek_struct. fields_for_serialize ( ) . count ( ) ;
524- debug ! ( " Serializing {fields} fields as array" ) ;
524+ trace ! ( " Serializing {fields} fields as array" ) ;
525525
526526 stack. push ( SerializeTask :: TupleStruct {
527527 items : peek_struct. fields_for_serialize ( ) ,
@@ -533,10 +533,10 @@ where
533533 ) ;
534534 }
535535 StructKind :: Struct => {
536- debug ! ( " Handling record struct" ) ;
536+ trace ! ( " Handling record struct" ) ;
537537 let peek_struct = cpeek. into_struct ( ) . unwrap ( ) ;
538538 let fields = peek_struct. fields_for_serialize ( ) . count ( ) ;
539- debug ! ( " Serializing {fields} fields as object" ) ;
539+ trace ! ( " Serializing {fields} fields as object" ) ;
540540
541541 stack. push ( SerializeTask :: Object {
542542 entries : peek_struct. fields_for_serialize ( ) ,
@@ -640,7 +640,7 @@ where
640640 }
641641 _ => {
642642 // Default case for any other definitions
643- debug ! (
643+ trace ! (
644644 "Unhandled type: {:?}, falling back to unit" ,
645645 cpeek. shape( ) . ty
646646 ) ;
0 commit comments