Skip to content

Commit

Permalink
[build] Revert removal of plist_to_bytes since it is depended on el…
Browse files Browse the repository at this point in the history
…sewhere
  • Loading branch information
amsam0 committed Sep 18, 2023
1 parent 5c6b858 commit 095f0b4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,17 @@ pub(crate) trait PlistPlusConversion {
impl PlistPlusConversion for Plist {
fn from_rusty_plist(plist: &Value) -> Result<Plist, PlistError> {
Plist::from_bin({
// We cannot use plist_to_bytes because it returns XML format while we want binary
let mut bytes = Vec::new();
plist::to_writer_binary(&mut bytes, plist).unwrap();
bytes
})
}
}

/// Converts a rusty plist Value to bytes in XML format. Panics on failure (but it shouldn't fail, if it does it's most likely your fault)
pub(crate) fn plist_to_bytes<P: Serialize>(plist: &P) -> Vec<u8> {
let mut bytes = Vec::new();
plist::to_writer_xml(&mut bytes, plist).unwrap();
bytes
}

0 comments on commit 095f0b4

Please sign in to comment.