From dcb0af4f5e873e26b5f95ff15467e2a66b65aae4 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 25 Sep 2019 22:31:10 -0400 Subject: [PATCH] Make the macro look like an enum declaration Interestingly enough, `cargo fmt` now recognizes and formats it --- src/control_protocol.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/control_protocol.rs b/src/control_protocol.rs index a8c8bea..343cfb2 100644 --- a/src/control_protocol.rs +++ b/src/control_protocol.rs @@ -8,10 +8,10 @@ use aeron_driver_sys::*; macro_rules! define_enum { ( $(#[$outer:meta])* - $name:ident, [$( + pub enum $name:ident {$( $(#[$inner:meta]),* - $left:ident = $right:ident - ),+] + $left:ident = $right:ident, + )+} ) => { #[repr(u32)] #[derive(Debug, PartialEq)] @@ -35,13 +35,12 @@ macro_rules! define_enum { define_enum!( #[doc = "Commands sent from clients to the Media Driver"] - ClientCommand, - [ + pub enum ClientCommand { #[doc = "Client declaring a new publication"] AddPublication = AERON_COMMAND_ADD_PUBLICATION, #[doc = "Client removing a publication"] - RemovePublication = AERON_COMMAND_REMOVE_PUBLICATION - ] + RemovePublication = AERON_COMMAND_REMOVE_PUBLICATION, + } ); #[cfg(test)]