Make base_app::subcommands macro look more like rust code

Summary:
Suggestion by markbt

This changes the macro syntax a little so it looks more like usual Rust code, which is better for syntax highlighters.

Reviewed By: mitrandir77

Differential Revision: D37998421

fbshipit-source-id: ffa2970dd5579acdcbbb32f0203a4f1ffe970d78
This commit is contained in:
Yan Soares Couto 2022-07-28 09:42:15 -07:00 committed by Facebook GitHub Bot
parent 0c6dc177de
commit 3ee61a698f
3 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ pub trait BaseApp {
/// Lower level version of mononoke_app::subcommands that allows changing the app
#[macro_export]
macro_rules! subcommands {
( $( mod $command:ident; )* app = $app:ty ) => {
( type App = $app:ty; $( mod $command:ident; )* ) => {
$( mod $command; )*
$crate::macro_export::assert_impl_all!($app: $crate::BaseApp);

View File

@ -59,6 +59,6 @@ pub mod macro_export {
#[macro_export]
macro_rules! subcommands {
( $( mod $command:ident; )* ) => {
$crate::macro_export::base_app::subcommands!{ $( mod $command; )* app = $crate::MononokeApp }
$crate::macro_export::base_app::subcommands!{ type App = $crate::MononokeApp; $( mod $command; )* }
}
}

View File

@ -8,6 +8,7 @@
use crate::ScscApp;
base_app::subcommands! {
type App = ScscApp;
mod cat;
mod repos;
mod blame;
@ -18,5 +19,4 @@ base_app::subcommands! {
mod info;
mod is_ancestor;
mod list_bookmarks;
app = ScscApp
}