addressing clippy lints

This commit is contained in:
realaravinth
2021-06-11 23:39:38 +05:30
parent ffdd1865bb
commit dcfba60c86
23 changed files with 124 additions and 109 deletions

View File

@@ -74,14 +74,14 @@ async fn set_email(
)
.execute(&data.db)
.await;
if !res.is_ok() {
if res.is_err() {
if let Err(sqlx::Error::Database(err)) = res {
if err.code() == Some(Cow::from("23505"))
&& err.message().contains("mcaptcha_users_email_key")
{
Err(ServiceError::EmailTaken)?
return Err(ServiceError::EmailTaken);
} else {
Err(sqlx::Error::Database(err))?
return Err(sqlx::Error::Database(err).into());
}
};
}