@@ -425,38 +425,36 @@ impl Serialize for Commit<'_> {
425
425
426
426
let mut commit = serializer. serialize_struct ( "Commit" , 9 ) ?;
427
427
commit. serialize_field ( "id" , & self . id ) ?;
428
- match & self . conv {
429
- Some ( conv) => {
430
- commit. serialize_field ( "message" , conv. description ( ) ) ?;
431
- commit. serialize_field ( "body" , & conv. body ( ) ) ?;
432
- commit. serialize_field ( "footers" , & SerializeFooters ( self ) ) ?;
433
- commit. serialize_field (
434
- "group" ,
435
- self . group . as_ref ( ) . unwrap_or ( & conv. type_ ( ) . to_string ( ) ) ,
436
- ) ?;
437
- commit. serialize_field (
438
- "breaking_description" ,
439
- & conv. breaking_description ( ) ,
440
- ) ?;
441
- commit. serialize_field ( "breaking" , & conv. breaking ( ) ) ?;
442
- commit. serialize_field (
443
- "scope" ,
444
- & self
445
- . scope
446
- . as_deref ( )
447
- . or_else ( || conv. scope ( ) . map ( |v| v. as_str ( ) ) )
448
- . or ( self . default_scope . as_deref ( ) ) ,
449
- ) ?;
450
- }
451
- None => {
452
- commit. serialize_field ( "message" , & self . message ) ?;
453
- commit. serialize_field ( "group" , & self . group ) ?;
454
- commit. serialize_field (
455
- "scope" ,
456
- & self . scope . as_deref ( ) . or ( self . default_scope . as_deref ( ) ) ,
457
- ) ?;
458
- }
428
+ if let Some ( conv) = & self . conv {
429
+ commit. serialize_field ( "message" , conv. description ( ) ) ?;
430
+ commit. serialize_field ( "body" , & conv. body ( ) ) ?;
431
+ commit. serialize_field ( "footers" , & SerializeFooters ( self ) ) ?;
432
+ commit. serialize_field (
433
+ "group" ,
434
+ self . group . as_ref ( ) . unwrap_or ( & conv. type_ ( ) . to_string ( ) ) ,
435
+ ) ?;
436
+ commit. serialize_field (
437
+ "breaking_description" ,
438
+ & conv. breaking_description ( ) ,
439
+ ) ?;
440
+ commit. serialize_field ( "breaking" , & conv. breaking ( ) ) ?;
441
+ commit. serialize_field (
442
+ "scope" ,
443
+ & self
444
+ . scope
445
+ . as_deref ( )
446
+ . or_else ( || conv. scope ( ) . map ( |v| v. as_str ( ) ) )
447
+ . or ( self . default_scope . as_deref ( ) ) ,
448
+ ) ?;
449
+ } else {
450
+ commit. serialize_field ( "message" , & self . message ) ?;
451
+ commit. serialize_field ( "group" , & self . group ) ?;
452
+ commit. serialize_field (
453
+ "scope" ,
454
+ & self . scope . as_deref ( ) . or ( self . default_scope . as_deref ( ) ) ,
455
+ ) ?;
459
456
}
457
+
460
458
commit. serialize_field ( "links" , & self . links ) ?;
461
459
commit. serialize_field ( "author" , & self . author ) ?;
462
460
commit. serialize_field ( "committer" , & self . committer ) ?;
0 commit comments