Fix clippy warning

This commit is contained in:
Billy Chan 2021-09-28 19:06:02 +08:00
parent 11781082ba
commit 966f7ff9a8
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7

View File

@ -73,7 +73,7 @@ where
// Only Statement impl Send
async fn exec_update(statement: Statement, db: &DatabaseConnection) -> Result<UpdateResult, DbErr> {
let result = db.execute(statement).await?;
if result.rows_affected() <= 0 {
if result.rows_affected() == 0 {
return Err(DbErr::RecordNotFound(
"None of the database rows are affected".to_owned(),
));