address rightward drift

This commit is contained in:
Robert Habermeier 2017-02-27 19:02:16 +01:00
parent da3c13f0a2
commit b487f00173

View File

@ -203,7 +203,8 @@ fn migrate_database(version: u32, db_path: PathBuf, mut migrations: MigrationMan
// completely in-place migration leads to the paths being equal. // completely in-place migration leads to the paths being equal.
// in that case, no need to shuffle directories. // in that case, no need to shuffle directories.
if temp_path != db_path { if temp_path == db_path { return Ok(()) }
// create backup // create backup
fs::rename(&db_path, &backup_path)?; fs::rename(&db_path, &backup_path)?;
@ -215,10 +216,7 @@ fn migrate_database(version: u32, db_path: PathBuf, mut migrations: MigrationMan
} }
// remove backup // remove backup
fs::remove_dir_all(&backup_path)?; fs::remove_dir_all(&backup_path).map_err(Into::into)
}
Ok(())
} }
fn exists(path: &Path) -> bool { fn exists(path: &Path) -> bool {