diff options
| author | Jokler <jokler.contact@gmail.com> | 2017-10-06 04:00:49 +0200 |
|---|---|---|
| committer | Jokler <jokler.contact@gmail.com> | 2017-10-11 15:41:32 +0200 |
| commit | 3bf595091370a76ef76d602909b387b284db410c (patch) | |
| tree | ffe93c51e83d9b4ab044286b788b8ff44012ec34 /src | |
| parent | 56e04f0798277196d75ed5654e01a19692b2b817 (diff) | |
| download | frippy-3bf595091370a76ef76d602909b387b284db410c.tar.gz frippy-3bf595091370a76ef76d602909b387b284db410c.zip | |
Add clippy as an optional build feature
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 7 | ||||
| -rw-r--r-- | src/plugins/emoji.rs | 4 |
2 files changed, 7 insertions, 4 deletions
@@ -1,3 +1,6 @@ +#![cfg_attr(feature="clippy", feature(plugin))] +#![cfg_attr(feature="clippy", plugin(clippy))] + extern crate irc; #[macro_use] extern crate lazy_static; @@ -24,9 +27,9 @@ pub fn run() { .for_each_incoming(|message| { let message = Arc::new(message); - for plugin in plugins.clone().into_iter() { + for plugin in plugins.clone() { let server = server.clone(); - let message = message.clone(); + let message = Arc::clone(&message); spawn(move || { let mut plugin = match plugin.lock() { diff --git a/src/plugins/emoji.rs b/src/plugins/emoji.rs index 6c24584..506fcd2 100644 --- a/src/plugins/emoji.rs +++ b/src/plugins/emoji.rs @@ -10,11 +10,11 @@ impl Emoji { fn emoji(&self, server: &IrcServer, content: &str, target: &str) -> Result<(), IrcError> { let mut names: Vec<String> = Vec::new(); - for emoji in self.return_emojis(&content) { + for emoji in self.return_emojis(content) { names.push(match unicode_names::name(emoji) { Some(v) => format!("{}", v).to_lowercase(), - None => format!("UNKNOWN"), + None => "UNKNOWN".to_string(), }); } |
