Update dependencies, remove unnecessary RwLock on database

This commit is contained in:
Roman Moisieiev 2025-09-11 08:55:07 +01:00
parent 7526a82bb7
commit 7b5626c279
20 changed files with 1114 additions and 983 deletions

View file

@ -18,11 +18,10 @@ pub(crate) mod admin {
use super::*;
pub async fn run(_command: &CommandInteraction, ctx: &Context) -> String {
let db_lock = {
let db = {
let data_read = ctx.data.read().await;
data_read.get::<DataBase>().expect("Expected Databse in TypeMap.").clone()
};
let db = db_lock.read().await;
let config_lock = {
let data_read = ctx.data.read().await;
@ -69,11 +68,10 @@ pub(crate) mod user {
use sqlx::{Pool, Sqlite};
pub async fn run(command: &CommandInteraction, ctx: &Context) -> String {
let db_lock = {
let db = {
let data_read = ctx.data.read().await;
data_read.get::<DataBase>().expect("Expected Databse in TypeMap.").clone()
};
let db = db_lock.read().await;
let config_toml = get_config_icons::minimal();
@ -145,11 +143,10 @@ pub(crate) mod user {
use sqlx::{Pool, Sqlite};
pub async fn run(_command: &CommandInteraction, ctx: &Context) -> String {
let db_lock = {
let db = {
let data_read = ctx.data.read().await;
data_read.get::<DataBase>().expect("Expected Databse in TypeMap.").clone()
};
let db = db_lock.read().await;
let config_toml = get_config_icons::minimal();