diff --git a/Cargo.toml b/Cargo.toml index a86ec39..c917e29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,4 @@ serenity = "0.12" tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] } tracing-subscriber = "0.3.20" supabase-lib-rs = "0.5.3" -serde = "1.0.228" +serde = "1.0.228" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index fc90f8f..fe8a072 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,6 @@ use dotenv::dotenv; use poise::serenity_prelude as serenity; -use std::{ - collections::HashMap, - sync::{Arc, Mutex}, -}; +use std::{collections::HashMap, sync::Mutex}; use supabase::Client; mod commands; mod events; @@ -18,10 +15,10 @@ type Error = Box; type Context<'a> = poise::Context<'a, Data, Error>; type ApplicationContext<'a> = poise::ApplicationContext<'a, Data, Error>; -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct AppState { - pub supabase: Arc, - pub student_cache: Arc>>, + pub supabase: Client, + pub student_cache: Mutex>, } impl AppState { @@ -32,8 +29,8 @@ impl AppState { let client = Client::new(&supabase_url, &supabase_key)?; Ok(Self { - supabase: Arc::new(client), - student_cache: Arc::new(Mutex::new(HashMap::new())), + supabase: client, + student_cache: Mutex::new(HashMap::new()), }) } }