Skip to content

Commit

Permalink
fixup! editoast: change Model trait DeleteStatic to use editoast_mode…
Browse files Browse the repository at this point in the history
…ls::Error

Signed-off-by: Leo Valais <leo.valais97@gmail.com>
  • Loading branch information
leovalais committed Jan 8, 2025
1 parent 6852ad7 commit 2d7acaa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions editoast/src/models/timetable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ impl Timetable {

#[async_trait::async_trait]
impl DeleteStatic<i64> for Timetable {
#[allow(clippy::blocks_in_conditions)] // TODO: Remove this once using clippy 0.1.80
#[tracing::instrument(name = "model:delete_static<Timetable>", skip_all, ret, err)]
async fn delete_static(
conn: &mut DbConnection,
id: i64,
) -> std::result::Result<bool, editoast_models::model::Error> {
) -> Result<bool, editoast_models::model::Error> {
let n = diesel::delete(dsl::timetable.filter(dsl::id.eq(id)))
.execute(conn.write().await.deref_mut())
.await?;
Expand All @@ -75,7 +74,6 @@ impl DeleteStatic<i64> for Timetable {

#[async_trait::async_trait]
impl Retrieve<i64> for Timetable {
#[allow(clippy::blocks_in_conditions)] // TODO: Remove this once using clippy 0.1.80
#[tracing::instrument(name = "model:retrieve<Timetable>", skip_all, err)]
async fn retrieve(
conn: &mut editoast_models::DbConnection,
Expand All @@ -92,7 +90,6 @@ impl Retrieve<i64> for Timetable {

#[async_trait::async_trait]
impl Exists<i64> for Timetable {
#[allow(clippy::blocks_in_conditions)] // TODO: Remove this once using clippy 0.1.80
#[tracing::instrument(name = "model:exists<Timetable>", skip_all, ret, err)]
async fn exists(conn: &mut DbConnection, id: i64) -> Result<bool> {
Self::retrieve(conn, id)
Expand Down

0 comments on commit 2d7acaa

Please sign in to comment.