mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-10 13:10:21 +08:00
12 lines
296 B
Rust
12 lines
296 B
Rust
use aether_data_contracts::DataLayerError;
|
|
|
|
pub(crate) trait SqlResultExt<T> {
|
|
fn map_sql_err(self) -> Result<T, DataLayerError>;
|
|
}
|
|
|
|
impl<T> SqlResultExt<T> for Result<T, sqlx::Error> {
|
|
fn map_sql_err(self) -> Result<T, DataLayerError> {
|
|
self.map_err(DataLayerError::sql)
|
|
}
|
|
}
|