summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs8
-rw-r--r--src/plugin.rs9
2 files changed, 8 insertions, 9 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 4cb6c44..efd15fd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,13 +14,7 @@ use irc::proto::Command::PRIVMSG;
use irc::error::Error as IrcError;
use plugin::Plugin;
-
-#[derive(Clone, Debug)]
-pub struct PluginCommand {
- source: String,
- target: String,
- tokens: Vec<String>,
-}
+use plugin::PluginCommand;
pub fn run() {
let server = IrcServer::new("config.toml").unwrap();
diff --git a/src/plugin.rs b/src/plugin.rs
index 62f4fbb..3791bf1 100644
--- a/src/plugin.rs
+++ b/src/plugin.rs
@@ -1,7 +1,6 @@
use std::fmt;
use irc::client::prelude::*;
use irc::error::Error as IrcError;
-use PluginCommand;
pub trait Plugin: Send + Sync + fmt::Display + fmt::Debug {
fn is_allowed(&self, server: &IrcServer, message: &Message) -> bool;
@@ -9,7 +8,13 @@ pub trait Plugin: Send + Sync + fmt::Display + fmt::Debug {
fn command(&mut self, server: &IrcServer, command: PluginCommand) -> Result<(), IrcError>;
}
-#[macro_export]
+#[derive(Clone, Debug)]
+pub struct PluginCommand {
+ pub source: String,
+ pub target: String,
+ pub tokens: Vec<String>,
+}
+
macro_rules! register_plugin {
($t:ident) => {
use std::fmt;