From 5fc28bfb2851441893ef2ad5f72e0feb8a0a22cc Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 25 Mar 2021 22:20:21 +0000 Subject: major: Publish work-in-progress --- src/utils/db.rs | 11 ++++++----- src/utils/mod.rs | 1 - src/utils/web.rs | 7 ------- 3 files changed, 6 insertions(+), 13 deletions(-) delete mode 100644 src/utils/web.rs (limited to 'src/utils') diff --git a/src/utils/db.rs b/src/utils/db.rs index adc11d3..e6e1946 100644 --- a/src/utils/db.rs +++ b/src/utils/db.rs @@ -1,15 +1,16 @@ -use sqlx::sqlite::{SqlitePool, SqlitePoolOptions}; -use std::env; +use sqlx::sqlite::SqlitePoolOptions; +use std::error::Error; +use sqlx::SqlitePool; -pub async fn get_pool() -> Result> { +pub async fn get_pool() -> Result> { let pool = SqlitePoolOptions::new() .max_connections(20) - .connect(&env::var("DATABASE_URL")?) + .connect(&std::env::var("DATABASE_URL")?) .await?; debug!( "connected to database at url '{}'", - &env::var("DATABASE_URL")? + &std::env::var("DATABASE_URL")? ); Ok(pool) diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 66f6db0..4e23340 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -1,3 +1,2 @@ pub mod byte; pub mod db; -pub mod web; diff --git a/src/utils/web.rs b/src/utils/web.rs deleted file mode 100644 index a834648..0000000 --- a/src/utils/web.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub fn _is_double_crnl(window: &[u8]) -> bool { - window.len() >= 4 - && (window[0] == '\r' as u8) - && (window[1] == '\n' as u8) - && (window[2] == '\r' as u8) - && (window[3] == '\n' as u8) -} -- cgit v1.2.3