0.1.16 upd

This commit is contained in:
Michael Wain 2025-02-15 02:52:58 +03:00
parent 8d388d1b0c
commit 48cd7b20c7
3 changed files with 4 additions and 4 deletions

2
Cargo.lock generated
View File

@ -90,7 +90,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
[[package]]
name = "itunesdb"
version = "0.1.15"
version = "0.1.16"
dependencies = [
"bincode",
"env_logger",

View File

@ -1,6 +1,6 @@
[package]
name = "itunesdb"
version = "0.1.15"
version = "0.1.16"
edition = "2021"
authors = ["alterwain"]

View File

@ -88,7 +88,7 @@ fn serialize_arguments(pl: &Vec<XPlArgument>) -> Vec<u8> {
.collect()
}
pub fn to_bytes(xdb: XDatabase) -> Vec<u8> {
pub fn to_bytes(xdb: &mut XDatabase) -> Vec<u8> {
let mut bytes: Vec<u8> = Vec::new();
for i in 0..xdb.children.len() {
let data_set = xdb.children.get(i).unwrap();
@ -160,7 +160,7 @@ pub fn to_bytes(xdb: XDatabase) -> Vec<u8> {
}
}
}
let sdb = bincode::serialize(&xdb.data.unwrap()).unwrap();
let sdb = bincode::serialize(&xdb.data.as_ref().unwrap()).unwrap();
let sdb_len = sdb.len();
let h = xdb.header.unwrap();
bytes = [sdb, generate_zeroes(h.end_of_chunk - sdb_len as u32), bytes].concat();