You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-09 04:22:45 +03:00
storage: freeze the error type on BoxRepository
This avoids having to deal with traits bounds everywhere. It also moves the `boxed()` method to the PgRepository, because it was unnecessary to keep it on the `Repository` trait
This commit is contained in:
@@ -18,7 +18,7 @@ use apalis_core::{executor::TokioExecutor, layers::extensions::Extension, monito
|
||||
use mas_email::Mailer;
|
||||
use mas_matrix::HomeserverConnection;
|
||||
use mas_router::UrlBuilder;
|
||||
use mas_storage::{BoxClock, BoxRepository, Repository, SystemClock};
|
||||
use mas_storage::{BoxClock, BoxRepository, SystemClock};
|
||||
use mas_storage_pg::{DatabaseError, PgRepository};
|
||||
use rand::SeedableRng;
|
||||
use sqlx::{Pool, Postgres};
|
||||
@@ -83,10 +83,7 @@ impl State {
|
||||
}
|
||||
|
||||
pub async fn repository(&self) -> Result<BoxRepository, DatabaseError> {
|
||||
let repo = PgRepository::from_pool(self.pool())
|
||||
.await?
|
||||
.map_err(mas_storage::RepositoryError::from_error)
|
||||
.boxed();
|
||||
let repo = PgRepository::from_pool(self.pool()).await?.boxed();
|
||||
|
||||
Ok(repo)
|
||||
}
|
||||
|
Reference in New Issue
Block a user