From ce18cfa2d67ccf6ec560d59da1753930e86d169c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 15 Apr 2018 21:31:14 +0200 Subject: refactor: Add a message!-macro to reduce message boilerplate --- src/oidc.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/oidc.rs') diff --git a/src/oidc.rs b/src/oidc.rs index d9ba4237be..3ec15854a8 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 for OidcExecutor { type Result = String; @@ -95,10 +92,7 @@ impl Handler 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; -} +message!(RetrieveToken, Result); #[derive(Debug, Deserialize)] struct TokenResponse { -- cgit 1.4.1