This commit is contained in:
parent
ccab3c247b
commit
4abf3f239f
2 changed files with 4 additions and 6 deletions
|
@ -57,7 +57,7 @@ fn save_bundle(bundle_dir: String, metadata_file_path: String, save_path: String
|
|||
|
||||
file.read_to_end(&mut buffer).unwrap();
|
||||
|
||||
zip_writer.write(&*buffer).unwrap();
|
||||
zip_writer.write_all(&*buffer).unwrap();
|
||||
}
|
||||
|
||||
zip_writer.finish().unwrap();
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
use std::{fs::File, io::{Write, Cursor}};
|
||||
use quick_xml::{se::Serializer, events::BytesStart};
|
||||
use std::{fs::File, io::{Write}};
|
||||
use quick_xml::{se::Serializer};
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde::ser::{SerializeSeq, SerializeStruct};
|
||||
|
||||
use serde_xml_rs::{to_string, to_writer};
|
||||
|
||||
#[derive(Debug, Deserialize, PartialEq, Clone)]
|
||||
pub(crate) struct Metadata {
|
||||
pub(crate) title: String,
|
||||
|
@ -139,7 +137,7 @@ impl Metadata {
|
|||
ser.indent(' ', 4);
|
||||
|
||||
self.serialize(ser).unwrap();
|
||||
file.write(buffer.as_bytes()).unwrap();
|
||||
file.write_all(buffer.as_bytes()).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue