mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
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:
parent
0c6dc177de
commit
3ee61a698f
@ -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);
|
||||
|
@ -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; )* }
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user