-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide internal macros from public interface #755
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#[macro_export] | ||
macro_rules! cfg_feature { | ||
($feature:literal, $($item:item)*) => { | ||
$( | ||
|
@@ -11,19 +10,19 @@ macro_rules! cfg_feature { | |
|
||
macro_rules! cfg_client { | ||
($($item:item)*) => { | ||
$crate::cfg_feature!("client", $($item)*); | ||
cfg_feature!("client", $($item)*); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure without trying, but things seem to work fine without properly namespacing the macro! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, here be dragons. I think there are situations when this will not work well, but can't remember what the full story was. |
||
}; | ||
} | ||
|
||
macro_rules! cfg_server { | ||
($($item:item)*) => { | ||
$crate::cfg_feature!("server", $($item)*); | ||
cfg_feature!("server", $($item)*); | ||
}; | ||
} | ||
|
||
macro_rules! cfg_http_helpers { | ||
($($item:item)*) => { | ||
$crate::cfg_feature!("http-helpers", $($item)*); | ||
cfg_feature!("http-helpers", $($item)*); | ||
}; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's this macro_export which makes the macro part of the public interface I believe.