From a9710893b85acf78701c323597a5357292bd6eb4 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sun, 20 Feb 2022 15:32:44 -0800 Subject: [PATCH] Make get_lists_data return a Map --- src/commands/kanji.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/kanji.rs b/src/commands/kanji.rs index 240306c..381cefe 100644 --- a/src/commands/kanji.rs +++ b/src/commands/kanji.rs @@ -3,6 +3,7 @@ use serenity::model::prelude::*; use serenity::prelude::*; use serde_json::Value; +use serde_json::Map; use std::fs::File; use std::io::Read; @@ -36,12 +37,12 @@ async fn display_kanji(ctx: &Context, msg: &Message, kanji: char, comment: &str) Ok(()) } -fn get_lists_data() -> Value { +fn get_lists_data() -> Map { let mut lists_file = File::open("kanji_lists.json").unwrap(); let mut lists_json = String::new(); lists_file.read_to_string(&mut lists_json).unwrap(); let lists_data: Value = serde_json::from_str(&lists_json).unwrap(); - lists_data + lists_data.as_object().unwrap().clone() } async fn random_kanji(