diff --git a/src/schema/resource_list.rs b/src/schema/resource_list.rs index 8968f91..5cab981 100644 --- a/src/schema/resource_list.rs +++ b/src/schema/resource_list.rs @@ -50,7 +50,7 @@ impl ResourceList { pub fn save(&self, path: impl AsRef + Debug) -> Result<(), ResourceSaveError> { info!("Creating backup before writing..."); let path = path.as_ref(); - std::fs::copy(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:?}..."); let file = std::fs::File::create(path).map_err(ResourceSaveError::FileOpen)?; self.save_to_writer(file)