style: cargo fmt --all

This commit is contained in:
2026-05-31 05:31:42 +02:00
parent 4b31a0f74b
commit c2ebca0da0
138 changed files with 2422 additions and 1164 deletions

View File

@@ -1,3 +1,4 @@
use crate::db::PgPool;
use async_trait::async_trait;
use domain::{
entities::User,
@@ -5,14 +6,15 @@ use domain::{
ports::UserRepository,
value_objects::{Email, PasswordHash, SystemId},
};
use crate::db::PgPool;
pub struct PostgresUserRepository {
pool: PgPool,
}
impl PostgresUserRepository {
pub fn new(pool: PgPool) -> Self { Self { pool } }
pub fn new(pool: PgPool) -> Self {
Self { pool }
}
}
#[async_trait]
@@ -26,12 +28,14 @@ impl UserRepository for PostgresUserRepository {
.await
.map_err(|e| DomainError::Internal(e.to_string()))?;
row.map(|r| Ok(User {
id: SystemId::from_uuid(r.id),
email: Email::new(r.email)?,
password_hash: PasswordHash::from_hash(r.password_hash),
created_at: r.created_at,
}))
row.map(|r| {
Ok(User {
id: SystemId::from_uuid(r.id),
email: Email::new(r.email)?,
password_hash: PasswordHash::from_hash(r.password_hash),
created_at: r.created_at,
})
})
.transpose()
}
@@ -44,12 +48,14 @@ impl UserRepository for PostgresUserRepository {
.await
.map_err(|e| DomainError::Internal(e.to_string()))?;
row.map(|r| Ok(User {
id: SystemId::from_uuid(r.id),
email: Email::new(r.email)?,
password_hash: PasswordHash::from_hash(r.password_hash),
created_at: r.created_at,
}))
row.map(|r| {
Ok(User {
id: SystemId::from_uuid(r.id),
email: Email::new(r.email)?,
password_hash: PasswordHash::from_hash(r.password_hash),
created_at: r.created_at,
})
})
.transpose()
}