diff options
| author | Fuwn <[email protected]> | 2021-03-25 22:20:21 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-03-25 22:20:21 +0000 |
| commit | 5fc28bfb2851441893ef2ad5f72e0feb8a0a22cc (patch) | |
| tree | f39b7bccc486298b1b7f4945cad37b4839817b73 /src/utils | |
| parent | feature: Byte utilities (diff) | |
| download | whirl-5fc28bfb2851441893ef2ad5f72e0feb8a0a22cc.tar.xz whirl-5fc28bfb2851441893ef2ad5f72e0feb8a0a22cc.zip | |
major: Publish work-in-progress
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) -} |