aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2017-10-14 04:46:05 +0200
committerJokler <jokler.contact@gmail.com>2017-10-14 04:46:05 +0200
commit4130d9b299265df7c06a9dcfa426746a870be615 (patch)
treeb35b6a64d77a0b6b01d76ded0db04c5ec7f8dbcf /src/lib.rs
parentbea4d2a63b15eb3f908d8612bdc94dca1829229f (diff)
downloadfrippy-4130d9b299265df7c06a9dcfa426746a870be615.tar.gz
frippy-4130d9b299265df7c06a9dcfa426746a870be615.zip
Adjust formatting with cargo fmt
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c556a32..873358a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -105,7 +105,9 @@ pub fn run() {
if let Some(mut c) = command.clone() {
// Skip empty commands
- if c.tokens.is_empty() { continue; }
+ if c.tokens.is_empty() {
+ continue;
+ }
if lock_plugin!(plugin).name().to_lowercase() == c.tokens[0].to_lowercase() {
@@ -132,10 +134,7 @@ fn get_command(nick: &str, message: &Message) -> Option<PluginCommand> {
if let PRIVMSG(_, ref content) = message.command {
// Split content by spaces and filter empty tokens
- let mut tokens: Vec<String> = content
- .split(' ')
- .map(ToOwned::to_owned)
- .collect();
+ let mut tokens: Vec<String> = content.split(' ').map(ToOwned::to_owned).collect();
// Commands start with our name
if tokens[0].to_lowercase().starts_with(nick) {
@@ -145,7 +144,10 @@ fn get_command(nick: &str, message: &Message) -> Option<PluginCommand> {
// We assume that only ':' and ',' are used as suffixes on IRC
// If there are any other chars we assume that it is not ment for the bot
- tokens[0] = tokens[0].chars().filter(|&c| !":,".contains(c)).collect();
+ tokens[0] = tokens[0]
+ .chars()
+ .filter(|&c| !":,".contains(c))
+ .collect();
if !tokens[0].is_empty() {
return None;
}