Netdoc: allow doc comments and visibility modifier in decl_keyword!
This commit is contained in:
parent
73752fb647
commit
5d3f13e6e7
|
@ -20,10 +20,12 @@
|
|||
/// assert_eq!(Location::from_str("stfff"), Location::UNRECOGNIZED);
|
||||
/// ```
|
||||
macro_rules! decl_keyword {
|
||||
{ $name:ident { $( $($s:literal)|+ => $i:ident),* $(,)? } } => {
|
||||
{ $(#[$meta:meta])* $v:vis
|
||||
$name:ident { $( $($s:literal)|+ => $i:ident),* $(,)? } } => {
|
||||
#[derive(Copy,Clone,Eq,PartialEq,Debug,std::hash::Hash)]
|
||||
#[allow(non_camel_case_types)]
|
||||
enum $name {
|
||||
$(#[$meta])*
|
||||
$v enum $name {
|
||||
$( $i , )*
|
||||
UNRECOGNIZED
|
||||
}
|
||||
|
|
|
@ -112,9 +112,9 @@ pub enum RelayPlatform {
|
|||
Other(String),
|
||||
}
|
||||
|
||||
// RouterKW is an instance of Keyword, used to denote the different
|
||||
// Items that are recognized as appearing in a router descriptor.
|
||||
decl_keyword! {
|
||||
/// RouterKW is an instance of Keyword, used to denote the different
|
||||
/// Items that are recognized as appearing in a router descriptor.
|
||||
RouterKW {
|
||||
"accept" | "reject" => POLICY,
|
||||
"bandwidth" => BANDWIDTH,
|
||||
|
|
Loading…
Reference in New Issue