File tree 2 files changed +12
-1
lines changed 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
Released on ReleaseDate.
8
8
9
+ * Added ` id ` field to ` Ea ` struct. (#155 )
9
10
* ` base64 ` 0.21 -> 0.22.
10
11
* ` cryptographic-message-syntax ` 0.26 -> 0.27.
11
12
* ` reqwest ` 0.11 -> 0.12.
Original file line number Diff line number Diff line change @@ -505,6 +505,8 @@ pub struct FileEncoding {
505
505
#[ derive( Clone , Debug , Deserialize ) ]
506
506
#[ serde( deny_unknown_fields, rename_all = "kebab-case" ) ]
507
507
pub struct Ea {
508
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
509
+ pub id : Option < u64 > ,
508
510
pub name : String ,
509
511
pub offset : u64 ,
510
512
pub size : u64 ,
@@ -516,7 +518,15 @@ pub struct Ea {
516
518
517
519
impl Ea {
518
520
pub fn write_xml < W : Write > ( & self , writer : & mut EventWriter < W > ) -> XarResult < ( ) > {
519
- writer. write ( XmlEvent :: start_element ( "ea" ) ) ?;
521
+ let mut ea = XmlEvent :: start_element ( "ea" ) ;
522
+
523
+ let id = self . id . map ( |x| format ! ( "{}" , x) ) ;
524
+
525
+ if let Some ( id) = & id {
526
+ ea = ea. attr ( "id" , id. as_str ( ) ) ;
527
+ }
528
+
529
+ writer. write ( ea) ?;
520
530
521
531
writer. write ( XmlEvent :: start_element ( "name" ) ) ?;
522
532
writer. write ( XmlEvent :: characters ( & self . name ) ) ?;
You can’t perform that action at this time.
0 commit comments