fixed a bug with checking for strings in toml arrays

This commit is contained in:
2025-06-07 17:08:40 +02:00
parent 203b7499dd
commit 8c5de5d10b
2 changed files with 1 additions and 3 deletions
-1
View File
@@ -8,7 +8,6 @@ subreddits = "bytedicetesting"
fetch_limit = 100 fetch_limit = 100
[commands] [commands]
# TODO: readme
# Disabled selected command categories. All commands and their categories can be viewed in the README. # Disabled selected command categories. All commands and their categories can be viewed in the README.
# "admin" and "owner" categories are always enabled. # "admin" and "owner" categories are always enabled.
# [REQUIRES RESTART] # [REQUIRES RESTART]
+1 -2
View File
@@ -141,8 +141,7 @@ async fn main() {
let cfg = get_toml_mutex(&data.cfg).await.unwrap(); let cfg = get_toml_mutex(&data.cfg).await.unwrap();
let cfg_arr = cfg["commands"]["disabled_categories"].as_array().unwrap(); let cfg_arr = cfg["commands"]["disabled_categories"].as_array().unwrap();
let contains: toml::Value = "re".parse().unwrap(); let run_py = !cfg_arr.iter().any(|val| val.as_str() == Some("re"));
let run_py = !cfg_arr.contains(&contains);
let rt_rs = Runtime::new().unwrap(); let rt_rs = Runtime::new().unwrap();
let rt_py = Runtime::new().unwrap(); let rt_py = Runtime::new().unwrap();