Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac8668 committed Jan 4, 2024
1 parent 09fc762 commit 2ffc5ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/chunk_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ fn prepare_chunk_gpu_textures(

pub fn save_to_file(chunk_manager: Res<ChunkManager>, input: Res<Input<KeyCode>>) {
if input.just_pressed(KeyCode::K) {
let file = File::open("assets/worlds/world").unwrap_or(File::create("assets/worlds/world").unwrap());
let file = File::open("assets/worlds/world")
.unwrap_or(File::create("assets/worlds/world").unwrap());
let mut file_chunks: HashMap<IVec2, Chunk> =
bincode::deserialize_from(BufReader::new(file)).unwrap_or_default();

Expand Down
5 changes: 4 additions & 1 deletion src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ pub fn send_manager_task(
saving_task.0 = Some(pool.spawn(async move {
let data = bincode::serialize(&file).unwrap();
//Save file
let _ = File::create("assets/worlds/world").unwrap().write(&data).unwrap();
let _ = File::create("assets/worlds/world")
.unwrap()
.write(&data)
.unwrap();
}));
}
AsyncTaskStatus::Pending => {}
Expand Down

0 comments on commit 2ffc5ba

Please sign in to comment.