about summary refs log tree commit diff
path: root/src/main.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-15T19·31+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-15T19·31+0200
commitce18cfa2d67ccf6ec560d59da1753930e86d169c (patch)
tree504f8eb63d615ac7d36de8f2778eade845f6e684 /src/main.rs
parentd9d1a3313f5cbceb5cb4878752fe0dc117bed3b0 (diff)
refactor: Add a message!-macro to reduce message boilerplate
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 9ec60044021d..8d81a670e0a2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -47,6 +47,16 @@ extern crate tokio_timer;
 extern crate url;
 extern crate url_serde;
 
+/// Simple macro used to reduce boilerplate when defining actor
+/// message types.
+macro_rules! message {
+    ( $t:ty, $r:ty ) => {
+        impl Message for $t {
+            type Result = $r;
+        }
+    }
+}
+
 pub mod db;
 pub mod errors;
 pub mod handlers;