summaryrefslogtreecommitdiffstats
path: root/src/plugins/emoji.rs
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2018-02-12 20:31:56 +0100
committerJokler <jokler.contact@gmail.com>2018-02-12 20:31:56 +0100
commit72f1411f1c72a9271c7d3993a3e307050e8d1b31 (patch)
tree92cbd36b13d09134ad5d8f23bf933c7aba0d7bb4 /src/plugins/emoji.rs
parentd761a8ad9650b4797a673230c2cc924235aafc98 (diff)
downloadfrippy-72f1411f1c72a9271c7d3993a3e307050e8d1b31.tar.gz
frippy-72f1411f1c72a9271c7d3993a3e307050e8d1b31.zip
Run latest rustfmt
Diffstat (limited to 'src/plugins/emoji.rs')
-rw-r--r--src/plugins/emoji.rs22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/plugins/emoji.rs b/src/plugins/emoji.rs
index 02a31f8..fcb04d1 100644
--- a/src/plugins/emoji.rs
+++ b/src/plugins/emoji.rs
@@ -14,7 +14,6 @@ struct EmojiHandle {
impl fmt::Display for EmojiHandle {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-
let name = match unicode_names::name(self.symbol) {
Some(sym) => sym.to_string().to_lowercase(),
None => String::from("UNKNOWN"),
@@ -52,7 +51,6 @@ impl Emoji {
count: 0,
};
-
for c in string.chars() {
if !self.is_emoji(&c) {
continue;
@@ -60,7 +58,6 @@ impl Emoji {
if current.symbol == c {
current.count += 1;
-
} else {
if current.count > 0 {
emojis.push(current);
@@ -99,13 +96,12 @@ impl Emoji {
impl Plugin for Emoji {
fn execute(&self, client: &IrcClient, message: &Message) -> ExecutionStatus {
match message.command {
- Command::PRIVMSG(_, ref content) => {
- match client.send_privmsg(message.response_target().unwrap(),
- &self.emoji(content)) {
- Ok(_) => ExecutionStatus::Done,
- Err(e) => ExecutionStatus::Err(e),
- }
- }
+ Command::PRIVMSG(_, ref content) => match client
+ .send_privmsg(message.response_target().unwrap(), &self.emoji(content))
+ {
+ Ok(_) => ExecutionStatus::Done,
+ Err(e) => ExecutionStatus::Err(e),
+ },
_ => ExecutionStatus::Done,
}
}
@@ -115,8 +111,10 @@ impl Plugin for Emoji {
}
fn command(&self, client: &IrcClient, command: PluginCommand) -> Result<(), IrcError> {
- client.send_notice(&command.source,
- "This Plugin does not implement any commands.")
+ client.send_notice(
+ &command.source,
+ "This Plugin does not implement any commands.",
+ )
}
fn evaluate(&self, _: &IrcClient, command: PluginCommand) -> Result<String, String> {