Skip to content

Commit

Permalink
util/diesel: Remove obsolete Conn trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Nov 22, 2024
1 parent 36ac593 commit f818546
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/util/diesel.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
use diesel::connection::LoadConnection;
use diesel::pg::Pg;
use diesel::result::Error;

pub trait Conn: LoadConnection<Backend = Pg> {}

impl<T> Conn for T where T: LoadConnection<Backend = Pg> {}

pub fn is_read_only_error(error: &Error) -> bool {
matches!(error, Error::DatabaseError(_, info) if info.message().ends_with("read-only transaction"))
}

0 comments on commit f818546

Please sign in to comment.