mirror of
https://github.com/bspeice/aeron-rs
synced 2024-12-22 05:48:10 -05:00
Make the macro look like an enum declaration
Interestingly enough, `cargo fmt` now recognizes and formats it
This commit is contained in:
parent
cef3a17d55
commit
dcb0af4f5e
@ -8,10 +8,10 @@ use aeron_driver_sys::*;
|
|||||||
macro_rules! define_enum {
|
macro_rules! define_enum {
|
||||||
(
|
(
|
||||||
$(#[$outer:meta])*
|
$(#[$outer:meta])*
|
||||||
$name:ident, [$(
|
pub enum $name:ident {$(
|
||||||
$(#[$inner:meta]),*
|
$(#[$inner:meta]),*
|
||||||
$left:ident = $right:ident
|
$left:ident = $right:ident,
|
||||||
),+]
|
)+}
|
||||||
) => {
|
) => {
|
||||||
#[repr(u32)]
|
#[repr(u32)]
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
@ -35,13 +35,12 @@ macro_rules! define_enum {
|
|||||||
|
|
||||||
define_enum!(
|
define_enum!(
|
||||||
#[doc = "Commands sent from clients to the Media Driver"]
|
#[doc = "Commands sent from clients to the Media Driver"]
|
||||||
ClientCommand,
|
pub enum ClientCommand {
|
||||||
[
|
|
||||||
#[doc = "Client declaring a new publication"]
|
#[doc = "Client declaring a new publication"]
|
||||||
AddPublication = AERON_COMMAND_ADD_PUBLICATION,
|
AddPublication = AERON_COMMAND_ADD_PUBLICATION,
|
||||||
#[doc = "Client removing a publication"]
|
#[doc = "Client removing a publication"]
|
||||||
RemovePublication = AERON_COMMAND_REMOVE_PUBLICATION
|
RemovePublication = AERON_COMMAND_REMOVE_PUBLICATION,
|
||||||
]
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
Reference in New Issue
Block a user