on main help sign in
Fix clippy warning for match on DB error
commit6fcab3c88debfeb860f299fb89b222513a41db4f authorfabianlindfors <fabian@flapplabs.se> dateTue 25 Jan 2022, 21:45 (5 years ago) parent40fb397
1 file changed+2−5
src/db.rs+2−5
src/db.rs+2−5
@@ -219,9 +219,6 @@ fn retry_automatically<T>(
219219
220220// Check if a database error can be retried
221221fn error_retryable(error: &postgres::error::DbError) -> bool {
222− match error.code() {
223− // Caused by lock_timeout being exceeded
224− &postgres::error::SqlState::LOCK_NOT_AVAILABLE => true,
225− _ => false,
226− }
222+ // LOCK_NOT_AVAILABLE is caused by lock_timeout being exceeded
223+ matches!(error.code(), &postgres::error::SqlState::LOCK_NOT_AVAILABLE)
227224}