mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 17:52:24 +00:00
run clippy fix
This commit is contained in:
@@ -15,16 +15,16 @@ pub enum Error {
|
||||
impl From<sqlx::Error> for Error {
|
||||
fn from(value: sqlx::Error) -> Self {
|
||||
match value {
|
||||
sqlx::Error::RowNotFound => Error::StoreError(rustical_store::Error::NotFound),
|
||||
sqlx::Error::RowNotFound => Self::StoreError(rustical_store::Error::NotFound),
|
||||
sqlx::Error::Database(err) => {
|
||||
if err.is_unique_violation() {
|
||||
warn!("{err:?}");
|
||||
Error::StoreError(rustical_store::Error::AlreadyExists)
|
||||
Self::StoreError(rustical_store::Error::AlreadyExists)
|
||||
} else {
|
||||
Error::SqlxError(sqlx::Error::Database(err))
|
||||
Self::SqlxError(sqlx::Error::Database(err))
|
||||
}
|
||||
}
|
||||
err => Error::SqlxError(err),
|
||||
err => Self::SqlxError(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user