diff --git a/src/bin/update_data.rs b/src/bin/update_data.rs index 0db63e6..bee6e97 100644 --- a/src/bin/update_data.rs +++ b/src/bin/update_data.rs @@ -16,7 +16,6 @@ async fn main() { get_wolves_csv(&db, &config).await; // handle wolves api here get_wolves(&db).await; - } async fn get_wolves_csv(db: &Pool, config: &Config) { diff --git a/src/commands/link_email.rs b/src/commands/link_email.rs index 7148af4..4ca115e 100644 --- a/src/commands/link_email.rs +++ b/src/commands/link_email.rs @@ -16,8 +16,8 @@ use skynet_discord_bot::{get_now_iso, random_string, Config, DataBase, Wolves, W use sqlx::{Pool, Sqlite}; pub(crate) mod link { - use serenity::model::id::UserId; use super::*; + use serenity::model::id::UserId; pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> String { let db_lock = { diff --git a/src/lib.rs b/src/lib.rs index 2dea62d..ebb7c2a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,12 +10,12 @@ use serenity::{ use chrono::{Datelike, SecondsFormat, Utc}; use rand::{distributions::Alphanumeric, thread_rng, Rng}; +use serenity::model::id::UserId; use sqlx::{ sqlite::{SqliteConnectOptions, SqlitePoolOptions, SqliteRow}, Error, FromRow, Pool, Row, Sqlite, }; use std::{env, str::FromStr, sync::Arc}; -use serenity::model::id::UserId; use tokio::sync::RwLock; pub struct Config { @@ -140,7 +140,7 @@ impl<'r> FromRow<'r, SqliteRow> for ServerMembersWolves { } _ => None, }; - + Ok(Self { server, id_wolves: row.try_get("id_wolves")?, @@ -168,7 +168,7 @@ impl<'r> FromRow<'r, SqliteRow> for Wolves { } _ => None, }; - + Ok(Self { id_wolves: row.try_get("id_wolves")?, email: row.try_get("email")?, @@ -258,8 +258,8 @@ pub async fn db_init(config: &Config) -> Result, Error> { minecraft text )", ) - .execute(&pool) - .await?; + .execute(&pool) + .await?; sqlx::query("CREATE INDEX IF NOT EXISTS index_discord ON wolves (discord)").execute(&pool).await?;