diff options
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/db.rs | 11 | ||||
| -rw-r--r-- | src/utils/mod.rs | 1 | ||||
| -rw-r--r-- | src/utils/web.rs | 7 |
3 files changed, 6 insertions, 13 deletions
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<SqlitePool, Box<dyn std::error::Error>> { +pub async fn get_pool() -> Result<SqlitePool, Box<dyn Error>> { 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) -} |