fix: clippy
This commit is contained in:
1 parent
a312f59dd1
commit
7775f119ed
2 files changed
+6
-4
No files matched your search
@@ -89,12 +89,10 @@ impl Level {
|
|||||||
pub async fn save(&self) {
|
pub async fn save(&self) {
|
||||||
log::info!("Saving level...");
|
log::info!("Saving level...");
|
||||||
// lets first save all chunks
|
// lets first save all chunks
|
||||||
let mut chunks_to_clean = vec![];
|
|
||||||
for chunk in self.loaded_chunks.iter() {
|
for chunk in self.loaded_chunks.iter() {
|
||||||
let chunk = chunk.read().await;
|
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
|
// then lets save the world info
|
||||||
self.world_info_writer
|
self.world_info_writer
|
||||||
.write_world_info(self.level_info.clone(), &self.level_folder)
|
.write_world_info(self.level_info.clone(), &self.level_folder)
|
||||||
|
|||||||
@@ -72,7 +72,11 @@ impl WorldInfoWriter for AnvilLevelInfo {
|
|||||||
|
|
||||||
// open file
|
// open file
|
||||||
let path = level_folder.root_folder.join(LEVEL_DAT_FILE_NAME);
|
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
|
// write compressed data into file
|
||||||
world_info_file.write_all(&compressed_data).unwrap();
|
world_info_file.write_all(&compressed_data).unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user