(LARGE COMMIT) refactored until no errors

This commit is contained in:
2026-03-01 14:15:55 +01:00
parent df7583263a
commit ed8904e26c
28 changed files with 322 additions and 289 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
use std::collections::HashMap;
use crate::{Context, Error, db::{generic::get_json_mutex, reddit::POSTS_KEY}, re_cmds::generic_fns::send_embed_for_post};
use crate::{Context, Error, db::reddit::POSTS_KEY, cmds::reddit::generic_fns::send_embed_for_post};
#[derive(poise::ChoiceParameter, PartialEq)]
enum TopCategory {
@@ -30,7 +30,7 @@ pub async fn cmd(
) -> Result<(), Error>
{
let mut all: HashMap<&str, i32> = HashMap::new();
let posts = &get_json_mutex(&ctx.data().reddit_data).await?[POSTS_KEY];
let posts = &ctx.data().reddit_data.lock().await[POSTS_KEY];
let posts_u = posts.as_object().unwrap();
for (url, dat) in posts_u {