fmt: danm formatting

This commit is contained in:
silver 2023-09-26 01:04:07 +01:00
parent 8760f4440a
commit abb00ff8c7
3 changed files with 6 additions and 7 deletions

View file

@ -16,7 +16,6 @@ async fn main() {
get_wolves_csv(&db, &config).await; get_wolves_csv(&db, &config).await;
// handle wolves api here // handle wolves api here
get_wolves(&db).await; get_wolves(&db).await;
} }
async fn get_wolves_csv(db: &Pool<Sqlite>, config: &Config) { async fn get_wolves_csv(db: &Pool<Sqlite>, config: &Config) {

View file

@ -16,8 +16,8 @@ use skynet_discord_bot::{get_now_iso, random_string, Config, DataBase, Wolves, W
use sqlx::{Pool, Sqlite}; use sqlx::{Pool, Sqlite};
pub(crate) mod link { pub(crate) mod link {
use serenity::model::id::UserId;
use super::*; use super::*;
use serenity::model::id::UserId;
pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> String { pub async fn run(command: &ApplicationCommandInteraction, ctx: &Context) -> String {
let db_lock = { let db_lock = {

View file

@ -10,12 +10,12 @@ use serenity::{
use chrono::{Datelike, SecondsFormat, Utc}; use chrono::{Datelike, SecondsFormat, Utc};
use rand::{distributions::Alphanumeric, thread_rng, Rng}; use rand::{distributions::Alphanumeric, thread_rng, Rng};
use serenity::model::id::UserId;
use sqlx::{ use sqlx::{
sqlite::{SqliteConnectOptions, SqlitePoolOptions, SqliteRow}, sqlite::{SqliteConnectOptions, SqlitePoolOptions, SqliteRow},
Error, FromRow, Pool, Row, Sqlite, Error, FromRow, Pool, Row, Sqlite,
}; };
use std::{env, str::FromStr, sync::Arc}; use std::{env, str::FromStr, sync::Arc};
use serenity::model::id::UserId;
use tokio::sync::RwLock; use tokio::sync::RwLock;
pub struct Config { pub struct Config {
@ -140,7 +140,7 @@ impl<'r> FromRow<'r, SqliteRow> for ServerMembersWolves {
} }
_ => None, _ => None,
}; };
Ok(Self { Ok(Self {
server, server,
id_wolves: row.try_get("id_wolves")?, id_wolves: row.try_get("id_wolves")?,
@ -168,7 +168,7 @@ impl<'r> FromRow<'r, SqliteRow> for Wolves {
} }
_ => None, _ => None,
}; };
Ok(Self { Ok(Self {
id_wolves: row.try_get("id_wolves")?, id_wolves: row.try_get("id_wolves")?,
email: row.try_get("email")?, email: row.try_get("email")?,
@ -258,8 +258,8 @@ pub async fn db_init(config: &Config) -> Result<Pool<Sqlite>, Error> {
minecraft text minecraft text
)", )",
) )
.execute(&pool) .execute(&pool)
.await?; .await?;
sqlx::query("CREATE INDEX IF NOT EXISTS index_discord ON wolves (discord)").execute(&pool).await?; sqlx::query("CREATE INDEX IF NOT EXISTS index_discord ON wolves (discord)").execute(&pool).await?;