From e5a6241e98297f8b947974ee173a5ea71d8a807a Mon Sep 17 00:00:00 2001 From: Yiu Tin Cheung Ivan Date: Tue, 20 Jun 2023 11:57:30 +0800 Subject: [PATCH] fmt --- src/executor/insert.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/executor/insert.rs b/src/executor/insert.rs index 5497b362d3..b48b063b0a 100644 --- a/src/executor/insert.rs +++ b/src/executor/insert.rs @@ -53,7 +53,10 @@ where TryInsertResult::Empty } else { let temp = self.insert_struct.exec(db).await; - if temp.is_err() && temp.as_ref().expect_err("must be error by previous check") == &DbErr::RecordNotInserted { + if temp.is_err() + && temp.as_ref().expect_err("must be error by previous check") + == &DbErr::RecordNotInserted + { return TryInsertResult::Conflicted; } TryInsertResult::Inserted(temp) @@ -75,7 +78,10 @@ where TryInsertResult::Empty } else { let temp = self.insert_struct.exec_without_returning(db).await; - if temp.is_err() && temp.as_ref().expect_err("must be error by previous check") == &DbErr::RecordNotInserted { + if temp.is_err() + && temp.as_ref().expect_err("must be error by previous check") + == &DbErr::RecordNotInserted + { return TryInsertResult::Conflicted; } TryInsertResult::Inserted(temp) @@ -96,7 +102,10 @@ where TryInsertResult::Empty } else { let temp = self.insert_struct.exec_with_returning(db).await; - if temp.is_err() && temp.as_ref().expect_err("must be error by previous check") == &DbErr::RecordNotInserted { + if temp.is_err() + && temp.as_ref().expect_err("must be error by previous check") + == &DbErr::RecordNotInserted + { return TryInsertResult::Conflicted; } TryInsertResult::Inserted(temp)