chore: linting

This commit is contained in:
Aravinth Manivannan 2023-01-24 19:21:54 +05:30
parent 33cd4e23bd
commit b66d5e7c70
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88

View file

@ -16,25 +16,20 @@
*/ */
use std::env; use std::env;
use lazy_static::lazy_static;
use sqlx::postgres::PgPoolOptions; use sqlx::postgres::PgPoolOptions;
mod settings; mod settings;
pub use settings::Settings; pub use settings::Settings;
#[cfg(not(tarpaulin_include))]
lazy_static! {
#[cfg(not(tarpaulin_include))]
pub static ref SETTINGS: Settings = Settings::new().unwrap();
}
#[cfg(not(tarpaulin_include))] #[cfg(not(tarpaulin_include))]
#[actix_rt::main] #[actix_rt::main]
async fn main() { async fn main() {
let settings = Settings::new().unwrap();
let db = PgPoolOptions::new() let db = PgPoolOptions::new()
.max_connections(SETTINGS.database.pool) .max_connections(settings.database.pool)
.connect(&SETTINGS.database.url) .connect(&settings.database.url)
.await .await
.expect("Unable to form database pool"); .expect("Unable to form database pool");
@ -53,7 +48,7 @@ fn build() {
// note: add error checking yourself. // note: add error checking yourself.
let output = Command::new("git") let output = Command::new("git")
.args(&["rev-parse", "HEAD"]) .args(["rev-parse", "HEAD"])
.output() .output()
.unwrap(); .unwrap();
let git_hash = String::from_utf8(output.stdout).unwrap(); let git_hash = String::from_utf8(output.stdout).unwrap();