From 0195219d5c0b0ff1486b3e6bdcd62a807d3d2932 Mon Sep 17 00:00:00 2001 From: Jokler Date: Tue, 10 Oct 2017 17:48:30 +0200 Subject: Create plugin_derive to replace the register_plugin macro --- src/plugins/emoji.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/plugins/emoji.rs') diff --git a/src/plugins/emoji.rs b/src/plugins/emoji.rs index c7054d8..b08b1b7 100644 --- a/src/plugins/emoji.rs +++ b/src/plugins/emoji.rs @@ -2,12 +2,16 @@ extern crate unicode_names; use irc::client::prelude::*; use irc::error::Error as IrcError; -use plugin::Plugin; -use PluginCommand; -register_plugin!(Emoji); +use plugin::*; +#[derive(PluginName, Debug)] +pub struct Emoji; impl Emoji { + pub fn new() -> Emoji { + Emoji {} + } + fn emoji(&self, server: &IrcServer, content: &str, target: &str) -> Result<(), IrcError> { let mut names: Vec = Vec::new(); @@ -73,5 +77,4 @@ impl Plugin for Emoji { } #[cfg(test)] -mod tests { -} +mod tests {} -- cgit v1.2.3-70-g09d2