-
Notifications
You must be signed in to change notification settings - Fork 174
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
fix: generate docs behind features #741
Conversation
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.
LGTM, its nice and cleaner
jsonrpsee-types = { path = "../types", version = "0.11.0", package = "jsonrpsee-types", optional = true } | ||
jsonrpsee-http-client = { path = "../client/http-client", version = "0.11.0", optional = true } | ||
jsonrpsee-ws-client = { path = "../client/ws-client", version = "0.11.0", optional = true } | ||
jsonrpsee-wasm-client = { path = "../client/wasm-client", version = "0.11.0", optional = true } |
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.
note added jsonrpsee-wasm-client
here
jsonrpsee/src/macros.rs
Outdated
macro_rules! cfg_proc_macros { | ||
($($item:item)*) => { | ||
$( | ||
#[cfg(feature = "jsonrpsee-proc-macros")] | ||
#[cfg_attr(docsrs, doc(cfg(feature = "jsonrpsee-proc-macros")))] | ||
$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.
Would it make sense to write a macro like:
macro_rules! cfg_feature {
($feature:literal, $($item:item)*) => {
$(
#[cfg(feature = $feature)]
#[cfg_attr(docsrs, doc(cfg(feature = $feature)))]
$item
)*
}
}
And then most of the other macros across these crates can just call that internally like:
macro_rules! cfg_proc_macros {
($($item:item)*) => cfg_feature!("jsonrpc-proc-macros", $($item:item)*)
}
There seem like enough copies to justify it :)
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.
yes, I agree
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.
LGTM, just one suggestion to reduce the macro repetition
Closing #668