Closed farwayer closed 2 years ago
I totally agree! However I don't know how to add a cfg
attribute in the current define_blocks!
macro. Just putting it before the block name gives this error:
error: no rules expected the token `#`
--> src/blocks.rs:76:5
|
24 | macro_rules! define_blocks {
| -------------------------- when calling this macro
...
76 | #[cfg(feature = "notmuch")]
| ^ no rules expected this token in macro call
I can't pass optional arguments to the macro too:
macro_rules! define_blocks {
($($block:ident ($cfg:literal)?),*) => { ... }
}
error: no rules expected the token `,`
--> src/blocks.rs:52:8
|
24 | macro_rules! define_blocks {
| -------------------------- when calling this macro
...
52 | apt,
| ^ no rules expected this token in macro call
or the user will be forced to install notmuch even if he does not use this block