on main help sign in
Fix clippy warning for match on DB error
6fcab3cfabianlindfors
src/db.rs+2−5
@@ -219,9 +219,6 @@ fn retry_automatically<T>(
219
219
220// Check if a database error can be retried
220// Check if a database error can be retried
221fn error_retryable(error: &postgres::error::DbError) -> bool {
221fn error_retryable(error: &postgres::error::DbError) -> bool {
222− match error.code() {
223− // Caused by lock_timeout being exceeded
222+ // LOCK_NOT_AVAILABLE is caused by lock_timeout being exceeded
224− &postgres::error::SqlState::LOCK_NOT_AVAILABLE => true,
223+ matches!(error.code(), &postgres::error::SqlState::LOCK_NOT_AVAILABLE)
225− _ => false,
226− }
227}
224}