aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-04-23 18:27:51 -0700
committerFuwn <[email protected]>2021-04-23 18:27:51 -0700
commitc58057b38550b94be623526481a31c7fc346a929 (patch)
tree7d851d0cf761fe4261dd5563f99e18d6c974d80b /src/utils
parentMerge branch 'tokio-re' of https://github.com/Whirlsplash/whirl into tokio-re (diff)
downloadwhirl-c58057b38550b94be623526481a31c7fc346a929.tar.xz
whirl-c58057b38550b94be623526481a31c7fc346a929.zip
major: :star:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/byte.rs3
-rw-r--r--src/utils/db.rs22
-rw-r--r--src/utils/mod.rs1
3 files changed, 11 insertions, 15 deletions
diff --git a/src/utils/byte.rs b/src/utils/byte.rs
deleted file mode 100644
index 01f10bb..0000000
--- a/src/utils/byte.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-pub fn convert_u16_to_two_u8s_be(integer: u16) -> [u8; 2] {
- [(integer >> 8) as u8, integer as u8]
-}
diff --git a/src/utils/db.rs b/src/utils/db.rs
index e6e1946..b95e159 100644
--- a/src/utils/db.rs
+++ b/src/utils/db.rs
@@ -1,17 +1,17 @@
-use sqlx::sqlite::SqlitePoolOptions;
use std::error::Error;
-use sqlx::SqlitePool;
+
+use sqlx::{sqlite::SqlitePoolOptions, SqlitePool};
pub async fn get_pool() -> Result<SqlitePool, Box<dyn Error>> {
- let pool = SqlitePoolOptions::new()
- .max_connections(20)
- .connect(&std::env::var("DATABASE_URL")?)
- .await?;
+ let pool = SqlitePoolOptions::new()
+ .max_connections(20)
+ .connect(&std::env::var("DATABASE_URL")?)
+ .await?;
- debug!(
- "connected to database at url '{}'",
- &std::env::var("DATABASE_URL")?
- );
+ debug!(
+ "connected to database at url '{}'",
+ &std::env::var("DATABASE_URL")?
+ );
- Ok(pool)
+ Ok(pool)
}
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 4e23340..dec1023 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -1,2 +1 @@
-pub mod byte;
pub mod db;