From 183f427143560d6e25aa3db60cf4a2091f15f694 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 27 Nov 2020 21:02:25 +0100 Subject: [PATCH] api-macros: Rename RawErrorType => ErrorType --- ruma-api-macros/src/api.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ruma-api-macros/src/api.rs b/ruma-api-macros/src/api.rs index 2c759755..0d2f0a6c 100644 --- a/ruma-api-macros/src/api.rs +++ b/ruma-api-macros/src/api.rs @@ -393,13 +393,6 @@ impl ToTokens for Api { } } -/// Custom keyword macros for syn. -mod kw { - use syn::custom_keyword; - - custom_keyword!(error); -} - /// The entire `ruma_api!` macro structure directly as it appears in the source code.. pub struct RawApi { /// The `metadata` section of the macro. @@ -412,7 +405,7 @@ pub struct RawApi { pub response: Response, /// The `error` section of the macro. - pub error: Option, + pub error: Option, } impl Parse for RawApi { @@ -426,12 +419,16 @@ impl Parse for RawApi { } } -pub struct RawErrorType { +mod kw { + syn::custom_keyword!(error); +} + +pub struct ErrorType { pub error_kw: kw::error, pub ty: Type, } -impl Parse for RawErrorType { +impl Parse for ErrorType { fn parse(input: ParseStream<'_>) -> syn::Result { let error_kw = input.parse::()?; input.parse::()?;