From db2fde30d67ce523a5efa32d41b2f88fbd414e21 Mon Sep 17 00:00:00 2001 From: Atheal <29005223+At-Heal@users.noreply.github.com> Date: Fri, 5 Jan 2024 05:31:49 +0100 Subject: [PATCH] refactor: :memo: just some comments and .vscode to gitignore --- .gitignore | 3 ++- src/main.rs | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c31be3c..70c6e82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target /data *.db -.env \ No newline at end of file +.env +.vscode \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index bbc4641..6a2676f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ #![forbid(unsafe_code)] #![warn(clippy::all, clippy::pedantic)] +// Import modules mod encryption; mod models; mod routes; @@ -43,14 +44,14 @@ async fn main() -> Result<()> { warn!("Lumen is running in debug mode. This is not recommended for production use."); } - let storage = Storage::new("data").await?; + let storage = Storage::new("data").await?; // Create a new instance of the Storage struct let pool = SqlitePoolOptions::new() .connect_with( SqliteConnectOptions::new() .filename("data/lumen.db") .create_if_missing(true), ) - .await?; + .await?; // Create a new connection pool to the SQLite database let config = ConfigCache { public_url: std::env::var("PUBLIC_URL").expect("PUBLIC_URL not set in environment"), @@ -59,7 +60,7 @@ async fn main() -> Result<()> { info!("Running migrations..."); // todo: support other databases (mysql, postgresql, etc) - sqlx::migrate!().run(&pool).await?; + sqlx::migrate!().run(&pool).await?; // Run database migrations let data = Data::new(AppData { pool, storage, config }); let bind = std::env::var("BIND").expect("BIND not set in environment");