From f582c36f97d6c4f728ac0d665ee1c68cb5c288d1 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:46:37 -0400 Subject: [PATCH] clippy --- src/core/bot_actions.rs | 22 +++++++++++++++++----- src/core/botinstance.rs | 4 ++-- src/core/botmodules.rs | 22 +++++++++++----------- src/core/chat.rs | 4 ++-- src/core/identity.rs | 10 +++++----- src/custom/experimental/experiment001.rs | 8 ++++---- src/custom/experimental/experiment002.rs | 6 +++--- 7 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/core/bot_actions.rs b/src/core/bot_actions.rs index 4b17758..ac04077 100644 --- a/src/core/bot_actions.rs +++ b/src/core/bot_actions.rs @@ -27,7 +27,19 @@ impl ExecBodyParams { let parent_act = Arc::clone(&self.parent_act); let parent_act_lock = parent_act.read().await; let act = &(*parent_act_lock); - let parent_module = match act { + // let parent_module = match act { + // BotAction::C(c) => { + // let temp = c.module.clone(); + // Some(temp) + // }, + // BotAction::L(l) => { + // let temp = l.module.clone(); + // Some(temp) + // }, + // _ => None + // }; + // parent_module + match act { BotAction::C(c) => { let temp = c.module.clone(); Some(temp) @@ -37,8 +49,7 @@ impl ExecBodyParams { Some(temp) }, _ => None - }; - parent_module + } } pub fn get_sender(&self) -> String { @@ -57,9 +68,10 @@ impl ExecBodyParams { } } - let requestor_badge = requestor_badge_mut; + // let requestor_badge = requestor_badge_mut; - requestor_badge + // requestor_badge + requestor_badge_mut } diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index ce55ff9..ee52c2f 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -20,7 +20,7 @@ use crate::core::ratelimiter::RateLimiter; // use crate::core::bot_actions::actions_util::BotAR; use crate::core::bot_actions::BotAR; use crate::core::botmodules::ModulesManager; -use crate::core::identity::{IdentityManager, Permissible,self}; +use crate::core::identity::{IdentityManager, Permissible}; use crate::core::botlog; use crate::core::chat::Chat; @@ -47,7 +47,7 @@ pub enum ChangeResult { pub struct Channel(pub String); use super::bot_actions::ExecBodyParams; -use super::botmodules::{BotAction, StatusType}; +use super::botmodules::StatusType; #[derive(Clone)] pub struct BotManagers { diff --git a/src/core/botmodules.rs b/src/core/botmodules.rs index 6fded1b..a0cfc45 100644 --- a/src/core/botmodules.rs +++ b/src/core/botmodules.rs @@ -24,7 +24,7 @@ use core::panic; use std::collections::HashMap; use std::sync::Arc; -use twitch_irc::message::PrivmsgMessage; +// use twitch_irc::message::PrivmsgMessage; use casual_logger::Log; @@ -33,7 +33,7 @@ use tokio::sync::RwLock; use async_trait::async_trait; // use self::bot_actions::actions_util::BotAR; -use crate::core::bot_actions::BotAR; +// use crate::core::bot_actions::BotAR; use crate::core::bot_actions::actions_util; use crate::core::bot_actions::ExecBodyParams; use crate::core::botinstance::{BotInstance, Channel,ChangeResult}; @@ -181,7 +181,7 @@ pub async fn init(mgr: Arc) { // if let None = trg_module { if trg_module.is_none() { - let botlock = params.bot.read().await; + // let botlock = params.bot.read().await; let outmsg = "uuh You need to pass a module"; @@ -197,13 +197,13 @@ pub async fn init(mgr: Arc) { let botclone = Arc::clone(&bot); let botlock = botclone.read().await; - let id = botlock.get_identity(); - let id = Arc::clone(&id); - let idlock = id.read().await; // <-- [ ] 03.24 - seems to work - let user_roles = idlock.getspecialuserroles( - params.msg.sender.name.clone(), - Some(Channel(params.msg.channel_login.clone())) - ).await; + // let id = botlock.get_identity(); + // let id = Arc::clone(&id); + // let idlock = id.read().await; // <-- [ ] 03.24 - seems to work + // let user_roles = idlock.getspecialuserroles( + // params.msg.sender.name.clone(), + // Some(Channel(params.msg.channel_login.clone())) + // ).await; botlock.botmgrs.chat.send_botmsg(super::chat::BotMsgType::Notif( outmsg.to_string() @@ -367,7 +367,7 @@ pub async fn init(mgr: Arc) { // _ => None, // }; - let parent_module = params.get_parent_module().await; + // let parent_module = params.get_parent_module().await; // [x] Unwraps arguments from message diff --git a/src/core/chat.rs b/src/core/chat.rs index f07eb55..9c365f6 100644 --- a/src/core/chat.rs +++ b/src/core/chat.rs @@ -12,7 +12,7 @@ use casual_logger::Log; use rand::Rng; -use crate::core::identity::Permissible; +// use crate::core::identity::Permissible; use crate::core::ratelimiter; use crate::core::ratelimiter::RateLimiter; @@ -23,7 +23,7 @@ use crate::core::botlog; use tokio::time::{sleep, Duration}; use super::bot_actions::ExecBodyParams; -use super::botmodules::BotModule; +// use super::botmodules::BotModule; use super::identity; diff --git a/src/core/identity.rs b/src/core/identity.rs index 756a50d..fa3a3e2 100644 --- a/src/core/identity.rs +++ b/src/core/identity.rs @@ -8,11 +8,11 @@ use twitch_irc::message::PrivmsgMessage; use casual_logger::Log; use crate::core::bot_actions::actions_util; -use crate::core::bot_actions::BotAR; +// use crate::core::bot_actions::BotAR; use crate::core::bot_actions::ExecBodyParams; use crate::core::botinstance::{Channel,ChangeResult}; use crate::core::botlog; -use crate::core::botmodules::BotAction; +// use crate::core::botmodules::BotAction; use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager}; use dotenv::dotenv; @@ -121,7 +121,7 @@ pub async fn init(mgr: Arc) { // _ => None, // }; - let parent_module = params.get_parent_module().await; + // let parent_module = params.get_parent_module().await; // println!("{}",params.msg.message_text); botlog::trace( @@ -331,7 +331,7 @@ pub async fn init(mgr: Arc) { // _ => None, // }; - let parent_module = params.get_parent_module().await; + // let parent_module = params.get_parent_module().await; // [x] Unwraps arguments from message @@ -540,7 +540,7 @@ pub async fn init(mgr: Arc) { // _ => None, // }; - let parent_module = params.get_parent_module().await; + // let parent_module = params.get_parent_module().await; let mut argv = params.msg.message_text.split(' '); diff --git a/src/custom/experimental/experiment001.rs b/src/custom/experimental/experiment001.rs index aa9575a..f1f880f 100644 --- a/src/custom/experimental/experiment001.rs +++ b/src/custom/experimental/experiment001.rs @@ -13,7 +13,7 @@ use rand::Rng; use std::sync::Arc; -use twitch_irc::message::PrivmsgMessage; +// use twitch_irc::message::PrivmsgMessage; use crate::core::bot_actions::ExecBodyParams; // use crate::core::botinstance::ChType::Channel; @@ -21,8 +21,8 @@ use crate::core::botinstance::Channel; use crate::core::botlog; use crate::core::bot_actions::actions_util; -use crate::core::bot_actions::BotAR; -use crate::core::botmodules::BotAction; +// use crate::core::bot_actions::BotAR; +// use crate::core::botmodules::BotAction; use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, Listener, ModulesManager}; use crate::core::identity::UserRole::*; @@ -215,7 +215,7 @@ async fn babygirl(params : ExecBodyParams) { - let parent_module = params.get_parent_module().await; + // let parent_module = params.get_parent_module().await; println!("babygirl triggered!"); // NOTE : This test function intends to print (e.g., to stdout) at fn call diff --git a/src/custom/experimental/experiment002.rs b/src/custom/experimental/experiment002.rs index fa4a6ce..f45e056 100644 --- a/src/custom/experimental/experiment002.rs +++ b/src/custom/experimental/experiment002.rs @@ -15,19 +15,19 @@ use std::sync::Arc; use chrono::{TimeZone,Local}; -use twitch_irc::message::PrivmsgMessage; +// use twitch_irc::message::PrivmsgMessage; use crate::core::bot_actions::ExecBodyParams; // use crate::core::botinstance::ChType::Channel; use crate::core::botinstance::Channel; // use ChType::Channel; use crate::core::botlog; -use crate::core::botmodules::BotAction; +// use crate::core::botmodules::BotAction; use casual_logger::Log; use crate::core::bot_actions::actions_util; -use crate::core::bot_actions::BotAR; +// use crate::core::bot_actions::BotAR; use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager}; use crate::core::identity::UserRole::*;