Update sea-orm dependencies to use workspace configuration; add dead code annotations in service error handling and settings service
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
pub type ServiceError = Box<dyn std::error::Error + Send + Sync>;
|
||||
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
pub trait IntoServiceError {
|
||||
fn into_service_error(self) -> ServiceError;
|
||||
}
|
||||
|
||||
@@ -15,9 +15,10 @@ pub struct AppState {
|
||||
pub service: Arc<AppService>,
|
||||
}
|
||||
|
||||
pub type ServiceState<T: ?Sized + Send + Sync> = Arc<T>;
|
||||
pub type ServiceState<T> = Arc<T>;
|
||||
|
||||
pub struct AppService {
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
pub settings: ServiceState<dyn SettingsStore>,
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,14 @@ use crate::errors::service_error::{IntoServiceError, ServiceError};
|
||||
|
||||
#[async_trait::async_trait]
|
||||
pub trait SettingsStore: Send + Sync {
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
async fn get_setting(&self, key: &str) -> Result<String, ServiceError>;
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
async fn set_setting(&self, key: &str, value: String) -> Result<(), ServiceError>;
|
||||
}
|
||||
|
||||
pub struct SettingsService {
|
||||
#[allow(dead_code)] // TODO: remove when used
|
||||
connection: Arc<DatabaseConnection>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user