Skip to content

Commit

Permalink
db: Run rustfmt on DB module
Browse files Browse the repository at this point in the history
  • Loading branch information
shymega committed Sep 7, 2023
1 parent ad47d92 commit 9634217
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ pub(crate) enum DbError {

pub(crate) type DbResult<T, E = DbError> = anyhow::Result<T, E>;

pub(crate) fn establish_connection(
) -> DbResult<SqliteConnection> {
dotenv().ok()
.ok_or(DbError::DotEnvMissing)?;
pub(crate) fn establish_connection() -> DbResult<SqliteConnection> {
dotenv().ok().ok_or(DbError::DotEnvMissing)?;

let url = env::var("DATABASE_URL")
.map_err(DbError::EnvVarMissing)?;
let url = env::var("DATABASE_URL").map_err(DbError::EnvVarMissing)?;

SqliteConnection::establish(&url)
.map_err(DbError::SqliteConnectionFailure)
SqliteConnection::establish(&url).map_err(DbError::SqliteConnectionFailure)
}

0 comments on commit 9634217

Please sign in to comment.