File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " icns-rs"
3- version = " 0.1.1 "
3+ version = " 0.1.2 "
44edition = " 2021"
55description = " A library for reading and writing Apple Icon Image (.icns) files."
66license = " LGPL-3.0-or-later"
Original file line number Diff line number Diff line change @@ -86,17 +86,17 @@ impl IconFamily {
8686 /// and compile all the data into a single file.
8787 pub fn build ( & self ) -> Box < [ u8 ] > {
8888 // Calculate the total size of the file
89- // let contents_table = self.create_contents_table();
89+ let contents_table = self . create_contents_table ( ) ;
9090
9191 // Insert the TOC first
9292 let mut data = Vec :: with_capacity ( self . data . len ( ) + 1 ) ;
93- // data.push(contents_table);
93+ data. push ( contents_table) ;
9494 for d in & self . data {
9595 data. push ( d. clone ( ) ) ;
9696 }
9797
9898 let total_size = data. iter ( ) . map ( |data| data. len ( ) ) . sum :: < u32 > ( ) ;
99- let mut buffer = Vec :: with_capacity ( total_size as usize ) ;
99+ let mut buffer = Vec :: with_capacity ( 8 + total_size as usize ) ;
100100
101101 // Add the magic bytes, the total size and the data
102102 buffer. extend_from_slice ( & MAGIC ) ;
You can’t perform that action at this time.
0 commit comments