Evaluate side effects outside of log macro

Otherwise, they will not be evaluated if the logger isn't init correctly
This commit is contained in:
crumblingstatue 2023-04-14 16:16:59 +02:00
parent 5b86b40e47
commit 0b491a91c5
3 changed files with 18 additions and 24 deletions

View file

@ -53,9 +53,7 @@ impl Player {
}
pub(crate) fn save(&self) {
log::info!(
"{:?}",
std::fs::write("player.dat", rmp_serde::to_vec(self).unwrap())
);
let result = std::fs::write("player.dat", rmp_serde::to_vec(self).unwrap());
log::info!("{result:?}");
}
}