From 6d12d5c0481c4d9d89bd4b59019183091ecb1972 Mon Sep 17 00:00:00 2001 From: crumblingstatue Date: Fri, 14 Apr 2023 12:03:22 +0200 Subject: [PATCH] Use zstd compression level 9 --- src/world.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/world.rs b/src/world.rs index 77eea85..939868b 100644 --- a/src/world.rs +++ b/src/world.rs @@ -46,6 +46,8 @@ pub struct World { pub name: String, } +const COMP_LEVEL: i32 = 9; + impl World { pub fn new(spawn_point: WorldPos, name: &str) -> Self { Self { @@ -81,7 +83,10 @@ impl World { let mut f = File::create(®_file_name).unwrap(); // Write an empty existence bitset f.write_all(&[0; 8]).unwrap(); - log::info!("{:?}", f.write_all(&zstd::encode_all(&[][..], 0).unwrap())); + log::info!( + "{:?}", + f.write_all(&zstd::encode_all(&[][..], COMP_LEVEL).unwrap()) + ); } let mut f = OpenOptions::new() .read(true) @@ -114,7 +119,7 @@ impl World { .unwrap(); log::info!( "{:?}", - f.write_all(&zstd::encode_all(&decomp[..], 0).unwrap()) + f.write_all(&zstd::encode_all(&decomp[..], COMP_LEVEL).unwrap()) ); } }