From 914f016e74dd2b7b28624a21b2dfee96726f7223 Mon Sep 17 00:00:00 2001 From: Hinton Date: Mon, 2 Sep 2024 17:12:09 +0200 Subject: [PATCH] Adjust migrator syntax --- crates/bitwarden-db/src/migrator.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/crates/bitwarden-db/src/migrator.rs b/crates/bitwarden-db/src/migrator.rs index 5c542e0bc..a844d75bb 100644 --- a/crates/bitwarden-db/src/migrator.rs +++ b/crates/bitwarden-db/src/migrator.rs @@ -52,17 +52,14 @@ impl Migrator { for migration in migrations { info!("Applying migration: {}", migration.description); - match current_version < target_version { - true => { - db.execute_batch(migration.up) - .await - .map_err(|_| MigratorError::MigrationFailed)?; - } - false => { - db.execute_batch(migration.down) - .await - .map_err(|_| MigratorError::MigrationFailed)?; - } + if current_version < target_version { + db.execute_batch(migration.up) + .await + .map_err(|_| MigratorError::MigrationFailed)?; + } else { + db.execute_batch(migration.down) + .await + .map_err(|_| MigratorError::MigrationFailed)?; } }