From: Ian Jackson Date: Sun, 31 Jan 2021 00:48:35 +0000 (+0000) Subject: daemon: api route macros: tolerate attrs on structs X-Git-Tag: otter-0.4.0~615 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7c51fdbda4a520341bbae41740438bb375bc41ec;p=otter.git daemon: api route macros: tolerate attrs on structs Signed-off-by: Ian Jackson --- diff --git a/daemon/api.rs b/daemon/api.rs index 82ffe356..9fa89756 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -195,22 +195,22 @@ macro_rules! api_route_core { macro_rules! api_route { { $fn:ident, $path:expr, - struct $form:ident { $( $body:tt )* } + $( #[ $attrs:meta ] )* struct $form:ident { $( $body:tt )* } $( $impl:tt )* } => { api_route_core!{ $fn, $path, $form, - struct $form { $( $body )* }, + $( #[ $attrs ] )* struct $form { $( $body )* }, $( $impl )* } }; { $fn:ident, $path:expr, - struct $form:ident ( $( $body:tt )* ); + $( #[ $attrs:meta ] )* struct $form:ident ( $( $body:tt )* ); $( $impl:tt )* } => { api_route_core!{ $fn, $path, $form, - struct $form ( $( $body )* );, + $( #[ $attrs ] )* struct $form ( $( $body )* );, $( $impl )* } }