Cargo fmt

This commit is contained in:
Karcsesz 2024-02-14 23:42:46 +01:00
parent 8523e80e64
commit cbaaf18cf5

View file

@ -50,7 +50,8 @@ impl ResourceList {
pub fn save(&self, path: impl AsRef<Path> + Debug) -> Result<(), ResourceSaveError> { pub fn save(&self, path: impl AsRef<Path> + Debug) -> Result<(), ResourceSaveError> {
info!("Creating backup before writing..."); info!("Creating backup before writing...");
let path = path.as_ref(); let path = path.as_ref();
std::fs::rename(path, path.with_extension("bak")).map_err(ResourceSaveError::BackupFailed)?; std::fs::rename(path, path.with_extension("bak"))
.map_err(ResourceSaveError::BackupFailed)?;
info!("Writing data to {path:?}..."); info!("Writing data to {path:?}...");
let file = std::fs::File::create(path).map_err(ResourceSaveError::FileOpen)?; let file = std::fs::File::create(path).map_err(ResourceSaveError::FileOpen)?;
self.save_to_writer(file) self.save_to_writer(file)