clippy cleanup
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful

clippy cleanup
This commit is contained in:
ModulatingForce 2024-03-23 20:29:18 -04:00
parent d372d0dc79
commit e4a44894d7
4 changed files with 21 additions and 42 deletions

View file

@ -272,17 +272,7 @@ impl BotInstance {
Some(msg),
);
// /*
// [ ] Here, msg is taken, and message_text is split so we can pull the first argument
// */
// let inpt = msg
// .message_text
// .split(' ')
// .next()
// .expect("ERROR during BotCommand");
/*
[ ] What we should do instead is :
1. Check if the message is related to a Reply (so we know how many arguments we should skip)
@ -295,14 +285,11 @@ impl BotInstance {
let arg1 = msgiter.next();
let arg2 = msgiter.next();
let reply = if let Some(replyidout) = msg.source.tags.0.get("reply-thread-parent-msg-id") {
if let Some(replyid) = replyidout {
// println!("Detected Reply : {}",replyid);
Some(replyid)
} else { None }
let reply = if let Some(Some(replyid)) = msg.source.tags.0.get("reply-thread-parent-msg-id") {
Some(replyid)
} else { None }
;
;
let inpt = match reply {

View file

@ -95,7 +95,7 @@ impl Chat {
let contextratelimiter = rllock
// .get_mut()
.get_mut(&Channel(String::from(channel_login.to_lowercase().clone())))
.get_mut(&Channel(channel_login.to_lowercase().clone()))
.expect("ERROR: Issue with Rate limiters");
// Continue to check the limiter and sleep if required if the minimum is not reached
@ -132,7 +132,7 @@ impl Chat {
botlog::trace(
logstr.as_str(),
Some("Chat > send_botmsg".to_string()),
Some(&msg),
Some(msg),
);
} else {
botlog::trace(

View file

@ -5,7 +5,7 @@
use std::sync::Arc;
pub use crate::core::botinstance::BotInstance;
// pub use crate::core::botinstance::BotInstance;
pub use crate::core::botmodules::ModulesManager;
// [ ] Load submodules

View file

@ -65,41 +65,33 @@ async fn sayout(bot: BotAR, msg: PrivmsgMessage) {
<target channel> <message>
*/
let reply_parent = if let Some(replyout) = msg.source.tags.0.get("reply-parent-msg-body") {
if let Some(replymsg) = replyout {
// println!("Detected Reply : {}",replyid);
Some(replymsg)
let reply_parent = if let Some(Some(reply)) = msg.source.tags.0.get("reply-parent-msg-body") {
Some(reply)
} else { None }
} else { None }
;
let reply_parent_usr = if let Some(replyout) = msg.source.tags.0.get("reply-thread-parent-user-login") {
if let Some(replymsgusr) = replyout {
// println!("Detected Reply : {}",replyid);
Some(replymsgusr)
let reply_parent_usr = if let Some(Some(reply)) = msg.source.tags.0.get("reply-thread-parent-user-login") {
Some(reply)
} else { None }
} else { None }
;
// [x] Unwraps arguments from message
let argrslt =
if let Some((_,str1)) = msg.message_text.split_once(" ") {
if let Some((_,str1)) = msg.message_text.split_once(' ') {
if reply_parent.is_none() {
if let Some((channelstr,msgstr)) = str1.split_once(" ") {
if let Some((channelstr,msgstr)) = str1.split_once(' ') {
Some((channelstr,msgstr))
}
else { None }
} else {
if let Some((_,str2)) = str1.split_once(" ") {
if let Some((channelstr,msgstr)) = str2.split_once(" ") {
Some((channelstr,msgstr))
}
else { None }
} else if let Some((_,str2)) = str1.split_once(' ') {
if let Some((channelstr,msgstr)) = str2.split_once(' ') {
Some((channelstr,msgstr))
}
else { None }
}
} else { None }
}
else { None };
@ -136,7 +128,7 @@ async fn sayout(bot: BotAR, msg: PrivmsgMessage) {
botlock
.botmgrs
.chat
.say_in_reply_to(&msg, format!("Not a Joined Channel : {}",trgchnl.to_string()))
.say_in_reply_to(&msg, format!("Not a Joined Channel : {}",trgchnl))
.await;