From 684dde255a167a3316b96a754842e957d57dad88 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 18 Oct 2021 14:11:17 +0200 Subject: [PATCH] Remove unused code and tests --- src/main.rs | 11 ++--------- src/sqlite/mod.rs | 12 ++++-------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index f0fa7f7..acfde77 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,8 +3,7 @@ use std::{ boxed::Box, error::Error, }; -use crate::{cli::Options, config::Config, sqlite::sqlite_out}; - +use crate::{cli::Options, config::Config}; mod cli; mod config; @@ -39,13 +38,7 @@ async fn main() -> Result<(), Box> { #[cfg(feature = "sqlite")] sqlite::load_template(&sqlite_connection).await?; - sqlite::add_test_user(&sqlite_connection).await?; - println!("{}" ,sqlite_out(&sqlite_connection, "SELECT * FROM users;", 1).await?); - - net::web(sqlite_connection).await; - Ok(()) - - + Ok(()) } \ No newline at end of file diff --git a/src/sqlite/mod.rs b/src/sqlite/mod.rs index 2fe5076..597f62d 100644 --- a/src/sqlite/mod.rs +++ b/src/sqlite/mod.rs @@ -6,7 +6,7 @@ use sqlx::{ SqliteQueryResult, SqliteSynchronous, }, - Row, + //Row, }; /// Prepare sqlite database connection @@ -30,10 +30,6 @@ pub async fn load_template(sqlite_handle: &SqlitePool) -> sqlx::Result sqlx::Result{ - sqlx::query("insert into users values('1923123','Elierik','erikeli',1,2,3);").execute(sqlite_handle).await -} - -pub async fn sqlite_out(sqlite_handle: &SqlitePool, query:&str, index:usize) -> Result { - sqlx::query(query).fetch_one(sqlite_handle).await.unwrap().try_get(index) -} \ No newline at end of file +//pub async fn sqlite_out(sqlite_handle: &SqlitePool, query:&str, index:usize) -> Result { +// sqlx::query(query).fetch_one(sqlite_handle).await.unwrap().try_get(index) +//} \ No newline at end of file