From 7c5d6b3d89b0e3cb844f4d63f8768d877eba905b Mon Sep 17 00:00:00 2001 From: Ten0 <9094255+Ten0@users.noreply.github.com> Date: Tue, 19 Jul 2022 19:31:23 +0200 Subject: [PATCH] Fix clippy Co-authored-by: Georg Semmler --- diesel_migrations/src/file_based_migrations.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diesel_migrations/src/file_based_migrations.rs b/diesel_migrations/src/file_based_migrations.rs index 75b26c33dd30..2aa5c1df78d6 100644 --- a/diesel_migrations/src/file_based_migrations.rs +++ b/diesel_migrations/src/file_based_migrations.rs @@ -186,10 +186,10 @@ impl Migration for SqlFileMigration { fn revert(&self, conn: &mut dyn BoxableConnection) -> migration::Result<()> { let down_path = self.base_path.join("down.sql"); - if !matches!(down_path.metadata(), Err(e) if e.kind() == std::io::ErrorKind::NotFound) { - Ok(run_sql_from_file(conn, &down_path, &self.name)?) - } else { + if matches!(down_path.metadata(), Err(e) if e.kind() == std::io::ErrorKind::NotFound) { Err(MigrationError::NoMigrationRevertFile.into()) + } else { + Ok(run_sql_from_file(conn, &down_path, &self.name)?) } }