Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
darkmmon committed Jun 20, 2023
1 parent 930f596 commit 0bfc031
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/executor/insert.rs
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 0bfc031

Please sign in to comment.