fix: clippy

This commit is contained in:
Alexander Medvedev 2025-01-08 12:51:16 +01:00
parent a312f59dd1
commit 7775f119ed
2 changed files with 6 additions and 4 deletions

View File

@ -89,12 +89,10 @@ impl Level {
pub async fn save(&self) {
log::info!("Saving level...");
// lets first save all chunks
let mut chunks_to_clean = vec![];
for chunk in self.loaded_chunks.iter() {
let chunk = chunk.read().await;
chunks_to_clean.push(chunk.position);
self.clean_chunk(&chunk.position).await;
}
self.clean_chunks(&chunks_to_clean).await;
// then lets save the world info
self.world_info_writer
.write_world_info(self.level_info.clone(), &self.level_folder)

View File

@ -72,7 +72,11 @@ impl WorldInfoWriter for AnvilLevelInfo {
// open file
let path = level_folder.root_folder.join(LEVEL_DAT_FILE_NAME);
let mut world_info_file = OpenOptions::new().create(true).write(true).open(path)?;
let mut world_info_file = OpenOptions::new()
.truncate(true)
.create(true)
.write(true)
.open(path)?;
// write compressed data into file
world_info_file.write_all(&compressed_data).unwrap();