remove props compression

This commit is contained in:
Evan Almloff committed 2023-07-07 11:08:27 -07:00
1 parent 7597068af6
commit c49c75cb60
4 files changed
+2 -9

No files matched your search

@@ -6,7 +6,6 @@ use base64::Engine;
#[allow(unused)]
pub(crate) fn serde_from_string<T: DeserializeOwned>(string: &str) -> Option<T> {
let decompressed = STANDARD.decode(string.as_bytes()).ok()?;
let (decompressed, _) = yazi::decompress(&decompressed, yazi::Format::Zlib).unwrap();
postcard::from_bytes(&decompressed).ok()
}
@@ -9,13 +9,7 @@ pub(crate) fn serde_to_writable<T: Serialize>(
write_to: &mut impl std::io::Write,
) -> std::io::Result<()> {
let serialized = postcard::to_allocvec(value).unwrap();
let compressed = yazi::compress(
&serialized,
yazi::Format::Zlib,
yazi::CompressionLevel::BestSize,
)
.unwrap();
write_to.write_all(&STANDARD.encode(compressed).as_bytes())?;
write_to.write_all(&STANDARD.encode(serialized).as_bytes())?;
Ok(())
}