chore: replace axum republish of async trait with actual async trait
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kasper Juul Hermansen 2025-01-10 00:02:50 +01:00
parent 75302c35c6
commit cb7f01e85d
Signed by: kjuulh
SSH Key Fingerprint: SHA256:RjXh0p7U6opxnfd3ga/Y9TCo18FYlHFdSpRIV72S/QM

View File

@ -26,11 +26,9 @@ pub struct GetLatestArtifact {
} }
pub mod traits { pub mod traits {
use axum::async_trait;
use super::{AddCommitArtifact, Artifact, GetLatestArtifact}; use super::{AddCommitArtifact, Artifact, GetLatestArtifact};
#[async_trait] #[async_trait::async_trait]
pub trait ArtifactsDB { pub trait ArtifactsDB {
async fn commit_artifact(&self, commit_artifact: AddCommitArtifact) -> anyhow::Result<()>; async fn commit_artifact(&self, commit_artifact: AddCommitArtifact) -> anyhow::Result<()>;
async fn get_latest_artifact( async fn get_latest_artifact(
@ -41,7 +39,6 @@ pub mod traits {
} }
pub mod defaults { pub mod defaults {
use axum::async_trait;
use sqlx::PgPool; use sqlx::PgPool;
use super::{traits, AddCommitArtifact, Artifact, GetLatestArtifact}; use super::{traits, AddCommitArtifact, Artifact, GetLatestArtifact};
@ -56,7 +53,7 @@ pub mod defaults {
} }
} }
#[async_trait] #[async_trait::async_trait]
impl traits::ArtifactsDB for DefaultArtifactsDB { impl traits::ArtifactsDB for DefaultArtifactsDB {
async fn commit_artifact(&self, commit_artifact: AddCommitArtifact) -> anyhow::Result<()> { async fn commit_artifact(&self, commit_artifact: AddCommitArtifact) -> anyhow::Result<()> {
sqlx::query("INSERT INTO artifacts (app, branch, artifact_id) VALUES ($1, $2, $3)") sqlx::query("INSERT INTO artifacts (app, branch, artifact_id) VALUES ($1, $2, $3)")