Loading crates/tor-basic-utils/src/lib.rs +2 −2 Original line number Original line Diff line number Diff line Loading @@ -162,10 +162,10 @@ macro_rules! define_accessor_trait { /// `macro_coalesce_args` takes each of its possible expansions in `[ ]` and returns /// `macro_coalesce_args` takes each of its possible expansions in `[ ]` and returns /// the first nonempty one. /// the first nonempty one. #[macro_export] #[macro_export] macro_rules! macro_coalesce_args { macro_rules! macro_first_nonempty { { [ $($yes:tt)+ ] $($rhs:tt)* } => { $($yes)* }; { [ $($yes:tt)+ ] $($rhs:tt)* } => { $($yes)* }; { [ ]$(,)? [ $($otherwise:tt)* ] $($rhs:tt)* } => { { [ ]$(,)? [ $($otherwise:tt)* ] $($rhs:tt)* } => { $crate::macro_coalesce_args!{ [ $($otherwise)* ] $($rhs)* } $crate::macro_first_nonempty!{ [ $($otherwise)* ] $($rhs)* } }; }; } } Loading crates/tor-config/src/lib.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -55,7 +55,7 @@ pub use err::{ConfigBuildError, ReconfigureError}; pub use mut_cfg::MutCfg; pub use mut_cfg::MutCfg; pub use path::CfgPath; pub use path::CfgPath; pub use tor_basic_utils::macro_coalesce_args; pub use tor_basic_utils::macro_first_nonempty; /// Rules for reconfiguring a running Arti instance. /// Rules for reconfiguring a running Arti instance. #[derive(Debug, Clone, Copy, Eq, PartialEq)] #[derive(Debug, Clone, Copy, Eq, PartialEq)] Loading crates/tor-config/src/list_builder.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -105,7 +105,7 @@ macro_rules! define_list_config_builder { let $things = $things let $things = $things .iter() .iter() .map( .map( $crate::macro_coalesce_args!{ $crate::macro_first_nonempty!{ [ $( $item_build )? ], [ $( $item_build )? ], [ |item| item.build() ], [ |item| item.build() ], } } Loading Loading
crates/tor-basic-utils/src/lib.rs +2 −2 Original line number Original line Diff line number Diff line Loading @@ -162,10 +162,10 @@ macro_rules! define_accessor_trait { /// `macro_coalesce_args` takes each of its possible expansions in `[ ]` and returns /// `macro_coalesce_args` takes each of its possible expansions in `[ ]` and returns /// the first nonempty one. /// the first nonempty one. #[macro_export] #[macro_export] macro_rules! macro_coalesce_args { macro_rules! macro_first_nonempty { { [ $($yes:tt)+ ] $($rhs:tt)* } => { $($yes)* }; { [ $($yes:tt)+ ] $($rhs:tt)* } => { $($yes)* }; { [ ]$(,)? [ $($otherwise:tt)* ] $($rhs:tt)* } => { { [ ]$(,)? [ $($otherwise:tt)* ] $($rhs:tt)* } => { $crate::macro_coalesce_args!{ [ $($otherwise)* ] $($rhs)* } $crate::macro_first_nonempty!{ [ $($otherwise)* ] $($rhs)* } }; }; } } Loading
crates/tor-config/src/lib.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -55,7 +55,7 @@ pub use err::{ConfigBuildError, ReconfigureError}; pub use mut_cfg::MutCfg; pub use mut_cfg::MutCfg; pub use path::CfgPath; pub use path::CfgPath; pub use tor_basic_utils::macro_coalesce_args; pub use tor_basic_utils::macro_first_nonempty; /// Rules for reconfiguring a running Arti instance. /// Rules for reconfiguring a running Arti instance. #[derive(Debug, Clone, Copy, Eq, PartialEq)] #[derive(Debug, Clone, Copy, Eq, PartialEq)] Loading
crates/tor-config/src/list_builder.rs +1 −1 Original line number Original line Diff line number Diff line Loading @@ -105,7 +105,7 @@ macro_rules! define_list_config_builder { let $things = $things let $things = $things .iter() .iter() .map( .map( $crate::macro_coalesce_args!{ $crate::macro_first_nonempty!{ [ $( $item_build )? ], [ $( $item_build )? ], [ |item| item.build() ], [ |item| item.build() ], } } Loading