From 7be3afa336f808f0dc3c9c622b02c6994a85e3f4 Mon Sep 17 00:00:00 2001 From: fabianlindfors Date: Mon, 9 Jan 2023 17:26:57 +0100 Subject: [PATCH] Fix error not stopping migration --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 55d47f3..b1a58ad 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -200,7 +200,7 @@ fn migrate( let mut last_action_index = usize::MAX; let mut result: anyhow::Result<()> = Ok(()); - for (migration_index, migration) in remaining_migrations.iter().enumerate() { + 'outer: for (migration_index, migration) in remaining_migrations.iter().enumerate() { println!("Migrating '{}':", migration.name); last_migration_index = migration_index; @@ -220,7 +220,7 @@ fn migrate( println!("{}", "done".green()); } else { println!("{}", "failed".red()); - break; + break 'outer; } }