1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Readability fixes for cargo clippy

This commit is contained in:
NG (Graham)
2025-09-03 22:33:26 -04:00
parent 9dcb12131b
commit 0e35aced01
77 changed files with 725 additions and 735 deletions

View File

@@ -36,7 +36,7 @@ impl ChatSystemConfig {
return result;
}
}
return "Invalid command".to_owned()
"Invalid command".to_owned()
}
pub fn is_command_channel(&self, channel: &str) -> bool {
@@ -66,11 +66,7 @@ impl ChatCommand {
}
fn perform_if_match(&self, text: &str, ctx: CommandContext) -> Option<String> {
if let Some(cap) = self.regex.captures(text) {
Some(self.op.perform_command(cap, ctx))
} else {
None
}
self.regex.captures(text).map(|cap| self.op.perform_command(cap, ctx))
}
}
@@ -122,7 +118,7 @@ impl BuiltIn {
}
},
Self::TotalUsers => {
format!("User count is not supported")
"User count is not supported".to_string()
},
}
}

View File

@@ -1,3 +1,4 @@
#[allow(clippy::module_inception)]
mod chat;
pub use chat::{ChatSystem, ChatProvider};