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:
@@ -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()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#[allow(clippy::module_inception)]
|
||||
mod chat;
|
||||
pub use chat::{ChatSystem, ChatProvider};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user