about summary refs log tree commit diff
path: root/src/oidc.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/oidc.rs
parentd9d1a3313f5cbceb5cb4878752fe0dc117bed3b0 (diff)
refactor: Add a message!-macro to reduce message boilerplate
Diffstat (limited to 'src/oidc.rs')
-rw-r--r--src/oidc.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/oidc.rs b/src/oidc.rs
index d9ba4237be00..3ec15854a8b2 100644
--- a/src/oidc.rs
+++ b/src/oidc.rs
@@ -70,10 +70,7 @@ impl Actor for OidcExecutor {
 
 /// Message used to request the login URL:
 pub struct GetLoginUrl; // TODO: Add a nonce parameter stored in session.
-
-impl Message for GetLoginUrl {
-    type Result = String;
-}
+message!(GetLoginUrl, String);
 
 impl Handler<GetLoginUrl> for OidcExecutor {
     type Result = String;
@@ -95,10 +92,7 @@ impl Handler<GetLoginUrl> for OidcExecutor {
 /// Message used to request the token from the returned code and
 /// retrieve userinfo from the appropriate endpoint.
 pub struct RetrieveToken(pub CodeResponse);
-
-impl Message for RetrieveToken {
-    type Result = Result<Author>;
-}
+message!(RetrieveToken, Result<Author>);
 
 #[derive(Debug, Deserialize)]
 struct TokenResponse {